/** Shopify CDN: Minification failed

Line 156:23 Unexpected "{"
Line 156:34 Expected ":"
Line 156:38 Unexpected "{"
Line 160:24 Unexpected "{"
Line 160:35 Expected ":"
Line 160:39 Unexpected "{"
Line 167:26 Unexpected "{"
Line 167:37 Expected ":"
Line 167:41 Unexpected "{"
Line 176:25 Unexpected "{"
... and 11 more hidden warnings

**/
/* ===== CSS VARIABLES ===== */
:root{
  --grid-size: 20;
  --grid-gap: 1px;
  --grid-padding: 1px;
  --grid-border: 1px;
  --primary-color: #222222;     /* main text */
  --secondary-color: #6B6B66;   /* muted text */
  --accent-color: #BD0D26;     
  --accent-hover: #7D0D26;
  --accent-color-glow:rgb(238, 209, 136); 
  --accent-color-transparent: rgba(189, 13, 38, 0.8);
  --accent-hover-transparent: rgba(125, 13, 38, 0.8);
  --success-color: #2E7D32;
  --background-color: #F7F5F0;  /* warm paper */
  --surface-color: #F4Ece5;
  --border-color: #D7D3CC;      /* hairline rule */
  --text-color: #222222;
  --text-muted: #6B6B66;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.10);
  --cell-size: 36px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --transition: all 0.18s cubic-bezier(.2, .1, .2, 1);
  --paper-texture: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.00) 100%);
  --lf-accent: #111111;
  --lf-accent-contrast: #ffffff;
  --lf-accent-soft: rgba(17,17,17,0.10);
  --lf-modal-accent: var(--lf-accent);
  --lf-modal-accent-contrast: var(--lf-accent-contrast);
  --lf-modal-accent-soft: var(--lf-accent-soft);

}

/* ===== RESET & BASE STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent zoom on mobile text inputs */
input[type="text"], 
input[type="email"], 
input[type="tel"], 
textarea, 
select {
    font-size: 16px;
}

/* ===== MAIN CONTAINER ===== */
.container.crossword-puzzle-generator {
    /* Theme-editor overrides */
    --lf-accent: var(--lf-builder-accent, var(--lf-modal-accent, var(--lf-accent, #111111)));
    --lf-accent-contrast: var(--lf-builder-accent-contrast, var(--lf-accent-contrast, #ffffff));
    --lf-accent-soft: rgba(17,17,17,0.10);
    max-width: 1400px;
    margin: 0rem auto;
    padding: 0.8rem;
    width: 100%;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


@supports (color: color-mix(in srgb, #000 50%, transparent)) {
  .container.crossword-puzzle-generator{
    --lf-accent-soft: color-mix(in srgb, var(--lf-accent) 12%, transparent);
  }
}

/* ===== HEADER STYLES ===== */
.crossword-puzzle-generator header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem 1rem;
    background: transparent;
    border-radius: var(--radius-lg);
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.crossword-puzzle-generator header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0.6;
}

.crossword-puzzle-generator header h1,
.crossword-puzzle-generator header h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 2.5rem;
  margin: 0;
  letter-spacing: -0.3px;
  spacing: -0.5px;
  color: var(--primary-color);
}

.input-section h3 {
  font-family: "lora";
  text-align: center;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 1px;
  letter-spacing: -0.3px;
  color: var(--primary-color);
}

.crossword-puzzle-generator header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0.5rem 0 0;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

.ai-theme-tiles__meta-{{ ai_gen_id }} {
  margin-top: 10px;
}

.ai-theme-tiles__price-{{ ai_gen_id }} {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  opacity: 0.85;
}

.ai-theme-tiles__divider-{{ ai_gen_id }} {
  height: 1px;
  width: 100%;
  margin: 12px 0;
  background: rgba(0,0,0,0.12);
}



.ai-theme-tiles__rating-{{ ai_gen_id }}{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
}

.ai-theme-tiles__stars-{{ ai_gen_id }}{
  letter-spacing:1px;
  line-height:1;
}

.ai-theme-tiles__rating-value-{{ ai_gen_id }},
.ai-theme-tiles__rating-count-{{ ai_gen_id }}{
  font-size: 0.95em;
  opacity: 0.9;
}

.lf-anchor{
  display:block;
  position:relative;
  top:-190px;     /* match your sticky header height */
  height:0;
  visibility:hidden;
}

/* ===== CONTROLS SECTION ===== */

.controls {
  display: none;
}
.crossword-puzzle-generator .controls {
    margin: 2rem 0;
    text-align: center;
}

/* ===== INPUT SECTION ===== */

.crossword-puzzle-generator .lf-answer-rules{
  margin: 8px 0 12px;
  font-size: 12px;
  line-height: 1.35;
  opacity: .95;

  /* small frame */
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 8px 10px;
  display: inline-block;          /* frame hugs content */
  max-width: 100%;
}

/* center the framed block under the title */
.crossword-puzzle-generator .lf-answer-rules{
  margin-left: auto;
  margin-right: auto;
}

.crossword-puzzle-generator .lf-answer-rules__items{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
}

.crossword-puzzle-generator .lf-answer-rule{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ✓ / ✕ icons */
.crossword-puzzle-generator .lf-answer-rule.is-ok::before{
  content: "✓";
  color: #16a34a;
  font-weight: 700;
}
.crossword-puzzle-generator .lf-answer-rule.is-no::before{
  content: "✕";
  color: #dc2626;
  font-weight: 700;
}

.crossword-puzzle-generator .lf-step.is-active{
  background: linear-gradient(135deg, var(--lf-accent),
              color-mix(in srgb, var(--lf-accent) 68%, #000 32%));
  color: var(--lf-accent-contrast);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

/* Desktop separator: horizontal line */
.crossword-puzzle-generator .lf-answer-rule:not(:last-child)::after{
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: #000;
  opacity: .35;
  margin: 0 12px;
  vertical-align: middle;
}

/* Mobile: dot separator instead of line */
@media (max-width: 480px){
  .crossword-puzzle-generator .lf-answer-rules{
    font-size: 11.5px;
    padding: 8px 9px;
    border-radius: 9px;
  }

  .crossword-puzzle-generator .lf-answer-rule:not(:last-child)::after{
    content: "•";
    width: auto;
    height: auto;
    background: transparent;
    opacity: .35;
    margin: 0 10px;
    font-weight: 700;
    line-height: 1;
  }
}

.crossword-puzzle-generator .input-section {
    margin-bottom: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.8rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.crossword-puzzle-generator .input-section h2 {
    color: var(--primary-color);
    font-family: 'lora';
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.crossword-puzzle-generator #word-clues {
    width: 100%;
    min-height: 120px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    transition: var(--transition);
    background: var(--background-color);
}

.crossword-puzzle-generator #word-clues:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
    background: var(--surface-color);
}



.crossword-puzzle-generator .lf-wordclues-hint {
    margin-top: -0.5rem;
    font-size: 0.85rem;
    color: #6b6b6b;
}


/* Hide canonical textarea but keep it in DOM for generator/preview/order logic */
.crossword-puzzle-generator #word-clues.lf-hidden-textarea {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Answer/Clue row editor (replaces big textarea UI) */
.crossword-puzzle-generator .lf-ac-editor {
    width: 100%;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
    margin: 1rem 0;
}

.crossword-puzzle-generator .lf-ac-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crossword-puzzle-generator .lf-ac-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    padding-left: 52px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-color);
}

.lf-ac-index{
  position:absolute;
  left: 14px;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 12px;
  color: var(--lf-accent);
  background: color-mix(in srgb, var(--lf-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--lf-accent) 30%, transparent);
  pointer-events:none;
}


.crossword-puzzle-generator .lf-ac-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crossword-puzzle-generator .lf-ac-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.crossword-puzzle-generator .lf-ac-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    font-size: 14px;
}

.crossword-puzzle-generator .lf-ac-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}

.crossword-puzzle-generator .lf-ac-remove {
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(0,0,0,0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.crossword-puzzle-generator .lf-ac-remove:hover {
    background: rgba(0,0,0,0.10);
}

.crossword-puzzle-generator .lf-ac-add {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.crossword-puzzle-generator .lf-ac-add:hover {
    border-color: var(--accent-color);
}

/* Give the answer/clue inputs a left gutter so the row number stays visible */
.crossword-puzzle-generator .lf-ac-row{
  --lf-num-gutter: 24px; /* tweak: 40–56px */
}

/* Works whether your fields are inputs or textareas, classed or not */
.crossword-puzzle-generator .lf-ac-row input,
.crossword-puzzle-generator .lf-ac-row textarea,
.crossword-puzzle-generator .lf-ac-row .lf-ac-input{
  padding-left: calc(16px + var(--lf-num-gutter)) !important;
}

/* If your number is the pseudo badge we added, keep it pinned left */
.crossword-puzzle-generator .lf-ac-row::before{
  left: 14px;
}

@media (max-width: 749px) {
  .crossword-puzzle-generator .lf-ac-row {
    position: relative;              /* NEW */
    grid-template-columns: 1fr;
    gap: 8px;                         /* smaller */
    padding: 10px;                    /* smaller */
  }

  .crossword-puzzle-generator .lf-ac-remove {
    position: absolute;               /* NEW */
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    justify-self: unset;              /* stop grid placement */
  }
}

/* Hide “next-step” controls until user starts typing */
.crossword-puzzle-generator .lf-hidden-until-start{
  display: none;
}

.crossword-puzzle-generator.is-started .lf-hidden-until-start,
.crossword-puzzle-generator.lf-has-words .lf-hidden-until-start{
  display: block;
  animation: lfFadeUp .18s ease both;
}

@keyframes lfFadeUp{
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== GRID SIZE CONTROL ===== */
.grid-size-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.grid-size-control label {
    font-weight: 600;
    color: var(--primary-color);
}

.grid-size-control input[type="range"] {
    flex: 1;
    max-width: 200px;
    margin: 0 1rem;
}

.grid-size-control input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* ===== BUTTON STYLES =====
   Single source of truth for generator + product modal + editor modal.
   IMPORTANT: Remove inline styles from JS buttons, otherwise CSS can't win.
*/

/* Button tokens */
:root{
  --lf-btn-radius: 14px;
  --lf-btn-py: 12px;
  --lf-btn-px: 18px;
  --lf-btn-border: rgba(17,17,17,0.22);
  --lf-btn-text: rgba(17,17,17,0.82);
  --lf-btn-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

/* Shared focus */
.crossword-puzzle-generator button:focus-visible,
.product-modal button:focus-visible,
.lf-product-modal button:focus-visible,
.editor-modal button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.80), 0 0 0 6px rgba(0,0,0,0.18);
}

/* ===== Generator buttons (.primary-button / .secondary-button / continue) ===== */
.crossword-puzzle-generator .button-group {
  width: 100%;
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  justify-content: center;
  flex-wrap: wrap;
}

.crossword-puzzle-generator .primary-button,
.crossword-puzzle-generator .secondary-button,
.crossword-puzzle-generator .continue-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: var(--lf-btn-py) var(--lf-btn-px);
  border-radius: var(--lf-btn-radius);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 140px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

/* Primary: solid theme accent */
.crossword-puzzle-generator .primary-button,
.crossword-puzzle-generator .continue-button,
.crossword-puzzle-generator #saveCrossword {
  width:
  background: var(--lf-accent);
  color: var(--lf-accent-contrast);
  border: 1px solid var(--lf-accent);
  box-shadow: var(--lf-btn-shadow);
}
.crossword-puzzle-generator .primary-button:hover,
.crossword-puzzle-generator .continue-button:hover,
.crossword-puzzle-generator #saveCrossword:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}
.crossword-puzzle-generator .primary-button:active,
.crossword-puzzle-generator .continue-button:active,
.crossword-puzzle-generator #saveCrossword:active {
  transform: translateY(0);
}

/* Secondary: outline */
.crossword-puzzle-generator .secondary-button,
.crossword-puzzle-generator #clear-button,
.crossword-puzzle-generator #lf-try-another-clue-set {
  background: transparent;
  color: var(--lf-btn-text);
  border: 1px solid var(--lf-btn-border);
  box-shadow: 0 1px 2px rgb(246, 167, 167);
}
@supports (color: color-mix(in srgb, #000 50%, transparent)) {
  .crossword-puzzle-generator .secondary-button,
  .crossword-puzzle-generator #clear-button,
  .crossword-puzzle-generator #lf-try-another-clue-set {
    border-color: color-mix(in srgb, var(--lf-accent) 35%, transparent);
  }
}
.crossword-puzzle-generator .secondary-button:hover,
.crossword-puzzle-generator #clear-button:hover,
.crossword-puzzle-generator #lf-try-another-clue-set:hover {
  transform: translateY(-1px);
  background: var(--lf-accent-soft);
  border-color: var(--lf-accent);
}

/* Disabled */
.crossword-puzzle-generator button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* ===== Modal button system ===== */
/* Use the same design language inside modals (they live outside .crossword-puzzle-generator). */
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm, .lf-preview-modal) button{
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* No "shrink + stuck" active state */
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm, .lf-preview-modal) button:active{
  transform: none !important;
}

:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm) .primary-button,
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm) .secondary-button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: var(--lf-btn-py) var(--lf-btn-px);
  border-radius: var(--lf-btn-radius);
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 48px;
  cursor: pointer;
  transition: filter 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

/* Primary */
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm) .primary-button{
  background: var(--lf-accent);
  color: var(--lf-accent-contrast);
  border: 1px solid var(--lf-accent);
  box-shadow: 0 0 0 2px var(--lf-accent-soft), var(--lf-btn-shadow);
}
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm) .primary-button:hover{
  filter: brightness(0.97);
}

/* Secondary */
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm) .secondary-button{
  background: transparent;
  color: var(--lf-btn-text);
  border: 1px solid var(--lf-btn-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
:where(.editor-modal, .lf-product-modal, #lf-pdf-confirm) .secondary-button:hover{
  filter: brightness(0.98);
}

/* ===== Product selection modal buttons ===== */
/* Make sure your product modal element has .product-modal OR .lf-product-modal */
.product-modal .customize-btn,
.lf-product-modal .customize-btn,
.product-modal #lf-modal-preview-pdf-btn,
.lf-product-modal #lf-modal-preview-pdf-btn,
.product-modal #lf-modal-buy-pdf-btn,
.lf-product-modal #lf-modal-buy-pdf-btn,
.product-modal .close-button,
.lf-product-modal .close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--lf-btn-py) var(--lf-btn-px);
  border-radius: var(--lf-btn-radius);
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

/* Product modal primary */
.product-modal #lf-modal-buy-pdf-btn,
.lf-product-modal #lf-modal-buy-pdf-btn {
  background: var(--lf-accent);
  color: var(--lf-accent-contrast);
  border: 1px solid var(--lf-accent);
  box-shadow: var(--lf-btn-shadow);
}
.product-modal #lf-modal-buy-pdf-btn:hover,
.lf-product-modal #lf-modal-buy-pdf-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

/* Product modal secondary */
.product-modal .customize-btn,
.lf-product-modal .customize-btn,
.product-modal #lf-modal-preview-pdf-btn,
.lf-product-modal #lf-modal-preview-pdf-btn {
  background: transparent;
  color: var(--lf-btn-text);
  border: 1px solid var(--lf-btn-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
@supports (color: color-mix(in srgb, #000 50%, transparent)) {
  .product-modal .customize-btn,
  .lf-product-modal .customize-btn,
  .product-modal #lf-modal-preview-pdf-btn,
  .lf-product-modal #lf-modal-preview-pdf-btn {
    border-color: color-mix(in srgb, var(--lf-accent) 35%, transparent);
  }
}
.product-modal .customize-btn:hover,
.lf-product-modal .customize-btn:hover,
.product-modal #lf-modal-preview-pdf-btn:hover,
.lf-product-modal #lf-modal-preview-pdf-btn:hover {
  transform: translateY(-1px);
  background: var(--lf-accent-soft);
  border-color: var(--lf-accent);
}

/* Product modal close (small pill) */
.product-modal .close-button,
.lf-product-modal .close-button {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  min-height: 0;
  background: transparent;
  color: var(--lf-btn-text);
  border: 1px solid var(--lf-btn-border);
}

/* Full width buttons in modal */
.product-modal #lf-modal-preview-pdf-btn,
.lf-product-modal #lf-modal-preview-pdf-btn,
.product-modal #lf-modal-buy-pdf-btn,
.lf-product-modal #lf-modal-buy-pdf-btn {
  width: 100%;
  max-width: 320px;
}

/* ===== Editor modal buttons ===== */
.editor-modal .lf-editor-actions{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.45);
}

.editor-modal .lf-editor-actions .primary-button,
.editor-modal .lf-editor-actions .secondary-button{
  width: 100%;
  min-width: 0;
}

/* Keep old class hooks working */
.editor-modal .preview-btn.secondary-button,
.editor-modal .back-button.secondary-button{
  /* styled via .secondary-button */
}

.editor-modal .add-to-cart-btn.primary-button{
  /* styled via .primary-button */
}

/* Mini control buttons (size/position) */
.editor-modal .control-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--lf-btn-border);
  background: rgba(255,255,255,0.55);
  color: var(--text-color);
  font-weight: 800;
  cursor: pointer;
  transition: filter 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.editor-modal .control-btn:hover{
  filter: brightness(0.98);
}
.editor-modal .control-btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== SHARED CONTROL AREAS ===== */
.puzzle-controls,
.action-buttons,
.warnings-container {
    text-align: center;
    margin: 2rem auto;
    max-width: 900px;
}

.clues-container{
    display:none; 
}
.puzzle-controls .puzzle-controls {
    margin: 0;
    padding: 0;
}

#saveCrossword {
    min-width: 380px;
    min-height: 45px;
    margin: 0 auto;
}

#image-preview {
    text-align: center;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ===== CROSSWORD GRID STYLES ===== */
.crossword-puzzle-generator #crossword-grid {
    display: grid;
    gap: var(--grid-gap);
    background: #000000;
    padding: var(--grid-padding);
    margin: 2rem auto;
    border: var(--grid-border) solid #000000;
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    width: fit-content;
    transform-origin: top center;
    grid-template-columns: repeat(var(--grid-size), var(--cell-size));
    grid-template-rows: repeat(var(--grid-size), var(--cell-size));
}

.crossword-puzzle-generator .cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border: 0;       
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    background-color: white;
    position: relative;
    transition: var(--transition);
    border-radius: 0;
}

.crossword-puzzle-generator .cell:hover {
    background-color:rgb(138, 149, 160);
    transform: scale(1.02);
}

.crossword-puzzle-generator .cell.filled {
    background:rgb(166, 129, 188);
    color: var(--primary-color);
}

.crossword-puzzle-generator .cell.black-cell {
    background: #222222;
}

.crossword-puzzle-generator .cell.first-letter {
    background:rgb(171, 120, 175);
    color: var(--primary-color);
}

.crossword-puzzle-generator .cell.empty-word {
    background:rgb(156, 114, 164);
    color: var(--primary-color);
}

.crossword-puzzle-generator .cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-muted);
}

/* ===== CROSSWORD LAYOUT CONTAINERS ===== */
.crossword-puzzle-generator .crossword-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    margin-top: 3rem;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.crossword-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}



.puzzle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.grid-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    position:relative;
}

/* FIX: your HTML uses .crossword-grid-wrapper, not .grid-wrapper */
.crossword-grid-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep the grid at its natural width so only the wrapper scrolls */
.crossword-grid-wrapper #crossword-grid {
  width: max-content;
}


#crossword-grid {
    margin: 0 auto;
    transform-origin: top center;
    transition: transform 0.3s ease;
    position:relative;
}

.puzzle-container h3 {
    color: var(--primary-color);
    font-family: 'lora';
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

/* ===== VERSION NAVIGATION ===== */
.version-navigation {
    font-family: 'lora';
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem auto;
    width: 100%;
}

.version-navigation button {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

.version-navigation button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.version-indicator {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    background: var(--background-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* ===== CLUE ROWS ===== */
#clue-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.clue-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.clue-row input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.clue-row .remove-row {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#add-clue-row {
    margin-top: 1rem;
}

/* ===== CLUES DISPLAY ===== */
.crossword-puzzle-generator .across-clues,
.crossword-puzzle-generator .down-clues {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  box-shadow: none !important;
  background: none !important;
}

.crossword-puzzle-generator .across-clues h3,
.crossword-puzzle-generator .down-clues h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.crossword-puzzle-generator .clue-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.crossword-puzzle-generator .clue-item:last-child {
    border-bottom: none;
}

.crossword-puzzle-generator .clue-item:hover {
    background: var(--background-color);
    border-radius: var(--radius-sm);
    padding-left: 0.5rem;
}

.crossword-puzzle-generator .clue-number {
    font-weight: 700;
    margin-right: 0.75rem;
    color: var(--accent-color);
}

/* ===== MODAL STYLES ===== */
/* Compact Modal */
.compact-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    min-width: 300px;
    max-width: 500px;
    border: 1px solid var(--border-color);
    animation: slideIn 0.3s ease-out;
}

.compact-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 1999;
    animation: fadeIn 0.3s ease-out;
}

.compact-modal h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.compact-modal p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

.compact-modal .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Legacy Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

/* Save Modal */
.save-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    z-index: 1100;
    width: 400px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.save-modal input {
    width: 100%;
    padding: 0.875rem;
    margin: 1rem 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
}

.save-modal input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.save-modal .button-group {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1090;
}

/* ===== PRODUCT MODAL & GRID ===== */
.product-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
}
/* ===== LF PRODUCT MODAL (current .lf-product-modal) ===== */
.lf-product-modal{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(8px);
  z-index: 10000;
}

/* Copy-friendly container */
.lf-product-modal .lf-modal-content{
  width: min(1200px, 97vw);
  max-height: 86vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: var(--shadow-lg);
}

.lf-product-modal .lf-modal-body{
  background: var(--background-color);
  color: var(--text-color);
  max-height: 86vh;
  overflow: auto;
  padding: 14px 14px 18px;
  position: relative;
}

/* Sticky "hello + close" bar */
.lf-product-modal .lf-modal-sticky-bar{
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  margin: -14px -14px 12px;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.lf-product-modal .lf-modal-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lf-product-modal .lf-modal-hello{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lf-product-modal .lf-modal-hello-title{
  font-family: var(--font-heading-family, inherit);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lf-product-modal .lf-modal-hello-sub{
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lf-product-modal .lf-modal-close{
  position: static !important;
  margin-left: auto;
  flex: 0 0 auto;
}

@media (max-width: 520px){
  .lf-product-modal{ padding: 8px; }
  .lf-product-modal .lf-modal-body{ padding: 12px 12px 16px; }
  .lf-product-modal .lf-modal-sticky-bar{ margin: -12px -12px 10px; }
  .lf-product-modal .tiny-product-logo{ width: 54px; height: 24px; }
}


.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
}

.product-card {
    border: 1px solid var(--border-color);
    display: flex;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
    background: var(--surface-color);
    max-width: 420px;
    margin: 0 auto;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color-glow);
}

.product-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.product-card h3 {
    width: 100%;
    margin: 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    word-wrap: break-word;
}

.product-card p {
    width: 100%;
    margin-top: auto;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Editor cloak to prevent FOUC */
.lf-editor--cloak {
  opacity: 0;
  visibility: hidden; /* still lays out (unlike display:none) */
}

.lf-editor--ready {
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease;
}

/* Make the stage predictable and prevent spillover */
.lf-stage {
  position: relative;
  overflow: hidden;
  /* If you know the aspect ratio, set it here to kill layout shifts. Example: */
  /* aspect-ratio: 3 / 4; */
}

/* The print area layer is absolutely positioned inside the stage */
.lf-print-area {
  position: absolute;
  /* Do NOT force full inset; JS sets top/left/width/height from Printify print area */
  overflow: hidden;
  transform-origin: top left;
  will-change: transform;
}


/* Inline preview controls (temporary theme-level) */
.inline-preview-controls button:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.08); }
.inline-preview-controls .inline-preview-center { min-width: 86px; text-align:center; }


/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
}

.pagination button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.pagination button:disabled {
    background: var(--background-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination .page-number {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== EDITOR STYLES ===== */
.editor-modal {
    position: fixed;
    /* Do NOT force full inset; JS sets top/left/width/height from Printify print area */
  overflow: hidden;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* align with other backdrops */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.editor-content {
    position: relative;
    z-index: 1;
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color); /* match cards/forms */
    width: min(1200px, 96vw);
    max-height: 94vh;
    overflow: auto;
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
}

/* optional header style (non-breaking if present) */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.editor-header h2 {
    margin: 0;
    font-size: clamp(1.25rem, 1.8vw, 1.75rem);
    color: var(--primary-color);
}
.editor-header .price {
    font-weight: 700;
    color: #000000;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* preview > controls */
    gap: 1.25rem;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.lf-bg-preview {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    z-index: 1;
}

.design-preview {
    z-index: 2;
}


.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}
/* ONLY center the main question label, not the radios */
.control-group > label {
  text-align: center;
  width: 100%;
}


.size-controls, 
.position-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.position-controls {
    grid-template-columns: repeat(4, 1fr);
}

textarea {
  font-size: 16px;
  line-height: 1.5;
  padding: 1rem;
  border-radius: 6px;
  background: #fdfdfd;
  border: 1px solid #ccc;
  font-family: 'Lora', serif !important;
}

.control-group input, 
.control-group select,
.control-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 16px;
    font-family: 'lora';
    transition: var(--transition);
}

.control-group input:focus, 
.control-group select:focus,
.control-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

/* Center the clue output label + radios */
.control-group .option-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 0;
}

/* Optional: style each radio label for consistent spacing */
.option-controls label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: var(--text-color);
  font-size: 15px;
}


/* editor action buttons (scoped, won’t affect global buttons) */
.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* === Editor: Size/Position controls + Preview button === */
.editor-brand {
  grid-column: 1 / -1;       /* span both columns */
  justify-self: center;      /* center the brand horizontally */
  align-self: start;         /* keep it at top of content */
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Stop grid items from stretching to tallest row */
.editor-layout {
  align-items: stretch; /* was default: stretch */
}



/* Lock the logo size on desktop */
.editor-brand img,
.tiny-logo,
.tiny-product-logo {
  height: 40px;      /* or 48px if you prefer */
  width: auto;
}
.product-logo {
  height: 100%;      /* or 48px if you prefer */
  width: auto;
}
/* (optional) only tighten on wider screens */
@media (min-width: 900px) {
  .editor-brand img,
  .tiny-logo,
  .tiny-product-logo { height: 40px; }
}

.tiny-logo {
  height: 60px;
  width: auto;
  opacity: 1;
}
.tiny-product-logo {
  height: 40px;
  width: auto;
  opacity: 1;
}


.size-controls .control-btn,
.position-controls .control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
}

/* Preview button: styled like a secondary action to match Back */
/* optional close icon button (non-breaking if not present) */
.editor-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}
.editor-close:hover { transform: translateY(-1px); }

/* Hide the Size controls entirely (DOM stays, logic untouched) */
.editor-content .size-controls { display: none !important; }

/* Hide the "Size" label that sits immediately before .size-controls */
.editor-content .editor-controls label:has(+ .size-controls) {
  display: none !important;
}

/* Fallback if :has() isn’t available (Chrome has it; if not, this is a safe guess):
   assumes the first label in .editor-controls is the Size label. */
@supports not (selector(:has(*))) {
  .editor-content .editor-controls > label:first-of-type {
    display: none !important;
  }
}

/* Hide Position controls (arrows) without touching logic */
.editor-content .position-controls { 
  display: none !important; 
}

/* Hide the "Position" label that precedes .position-controls */
.editor-content .editor-controls label:has(+ .position-controls) {
  display: none !important;
}

/* Fallback for browsers without :has() support.
   In your template the labels are: 1) Size, 2) Position */
@supports not (selector(:has(*))) {
  .editor-content .editor-controls > label:nth-of-type(2) {
    display: none !important;
  }
}

/* ===== PRODUCT DESIGN ELEMENTS ===== */
.print-area {
    position: absolute;
    border: 2px dashed var(--accent-color);
    pointer-events: none;
    border-radius: var(--radius-sm);
    overflow: hidden; /* important: keep bg inside the frame */
}

.lf-bg-preview {
    position: absolute;
    /* Do NOT force full inset; JS sets top/left/width/height from Printify print area */
  overflow: hidden;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    z-index: 1;
    pointer-events: none;
}

.design-preview {
    position: absolute;
    /* Do NOT force full inset; JS sets top/left/width/height from Printify print area */
  overflow: hidden;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    z-index: 2;
    pointer-events: none;
}

.preview-area .product-preview{
  width: 100%;
  height: min(78vh, 900px);
}

html.modal-open, body.modal-open{ overflow: hidden; }

.product-preview {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.product-base { 
    display: block; 
    width: 100%; 
    height: auto;
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

/* ===== FEEDBACK MODAL ===== */
#feedback-modal {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 2000;
    background: var(--surface-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    border: 1px solid var(--border-color);
}

/* ===== MESSAGE STYLES ===== */
.success-message {
    color: var(--success-color);
    font-weight: 600;
}

.error-message {
    color: var(--accent-color);
    font-weight: 600;
}


/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */
/* Grid Scaling */
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .preview-area .product-preview { height: 60vh; }
  .editor-content { width: 98vw; height: 94vh; }

  /* Make available width truly equal to viewport width */
  .puzzle-container { padding: 0; margin: 0; }

  .crossword-grid-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 95%;
  }

  /* Fit grid to viewport width, including gap/padding/border */
  .crossword-puzzle-generator #crossword-grid {
    transform-origin: top center;
  }

  .crossword-puzzle-generator .cell-number {
    font-size: 6.5px;
    font-weight: 600;
    line-height: 1;
  }
}

@supports (padding-left: env(safe-area-inset-left)){
  .page-width, .container { padding-left: max(2.5px, env(safe-area-inset-left)); }
}

/* allow wrappers to shrink on mobile */
@media (max-width: 768px) {
  .crossword-puzzle-generator .puzzle-container,
  .crossword-puzzle-generator .grid-wrapper,
  #image-preview {
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
  }
}


/* Tablet Styles */
@media (max-width: 768px) {
    body {
      padding: 0;
      margin: 0;
    }
    .container.crossword-puzzle-generator {
        margin: 0;
        padding: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .crossword-puzzle-generator .crossword-section {
        max-width: 100%;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .crossword-puzzle-generator {
--cell-size: clamp(14px, calc((100vw - 48px) / var(--grid-size)), 26px);    }
    
    .crossword-puzzle-generator header h1 {
        font-size: 2rem;
    }
    
    .crossword-puzzle-generator .cell {
        font-size: 14px;
    }
    
    .crossword-puzzle-generator .cell-number {
        font-size: 7px;
    }
    
    .crossword-puzzle-generator .button-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .save-modal {
        width: 90%;
        max-width: 350px;
    }
    
    .compact-modal {
        width: 90%;
        max-width: 350px;
    }
    
    .editor-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .print-area {
        border-width: 2px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display:flex; 
        align-items:center; 
        justify-content:center; /* keeps image centered */
    }
    
    .product-preview {
        min-height: 200px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Editor preview container should size to image */
#preview-container { position: relative; display: inline-block; }

/* =========================================================
   LoveFrames / LF shared UX styles (SINGLE COPY)
   - Theme accent variables
   - Hero overlay readability
   - Template carousel hints
   - Generator onboarding/tooltip
   - Solution UI selection (UI only)
   - Bottom action bar (mobile friendly)
   - Modal scroll lock + overscroll containment
   ========================================================= */

/* Theme accents (set these once; buttons read --lf-accent) */
body.theme-default { --lf-accent: #111111; --lf-accent-contrast: #ffffff; --lf-accent-soft: rgba(17,17,17,0.10); }
body.theme-wedding { --lf-accent: #D4AF37; --lf-accent-contrast: #111111; --lf-accent-soft: rgba(212,175,55,0.16); }
body.theme-birthday { --lf-accent: #9B6A8D; --lf-accent-contrast: #ffffff; --lf-accent-soft: rgba(155,106,141,0.14); }
body.theme-valentines { --lf-accent: #E11D48; --lf-accent-contrast: #ffffff; --lf-accent-soft: rgba(225,29,72,0.14); }
body.theme-couples { --lf-accent: #C58BDF; --lf-accent-contrast: #ffffff; --lf-accent-soft: rgba(197,139,223,0.14); }
body.theme-friendship { --lf-accent: #AE6C2D; --lf-accent-contrast: #ffffff; --lf-accent-soft: rgba(174,108,45,0.14); }
body.theme-christmas { --lf-accent: #16A34A; --lf-accent-contrast: #ffffff; --lf-accent-soft: rgba(22,163,74,0.14); }
body.theme-babyshower { --lf-accent: #F59E0B; --lf-accent-contrast: #111111; --lf-accent-soft: rgba(245,158,11,0.14); }

/* Make modals inherit the per-theme accent even if you set --lf-modal-accent inline */
.editor-modal,
.product-modal,
.lf-product-modal {
  --lf-accent: var(--lf-modal-accent, var(--lf-accent));
  --lf-accent-contrast: var(--lf-modal-accent-contrast, var(--lf-accent-contrast));
  --lf-accent-soft: var(--lf-modal-accent-soft, var(--lf-accent-soft));
}

/* ---------- HERO readability ---------- */
.lf-hero .lf-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}

.lf-hero .lf-hero-microline {
  font-family: var(--font-body-family);
  font-style: var(--font-body-style);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 30px;
  line-height: 1.3;
  font-size: 14px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.55);
}

@media screen and (min-width: 750px) {
  .lf-hero .lf-hero-microline { font-size: 15px; margin-bottom: 34px; }
}

/* ---------- Template carousel guidance text ---------- */
.lf-template-carousel .lf-template-carousel__hint-top,
.lf-template-carousel .lf-template-carousel__hint-bottom {
  margin: 0 0 14px;
  text-align: center;
  font-family: var(--font-body-family);
  font-style: var(--font-body-style);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 14px rgba(0,0,0,0.55);
}

.lf-template-carousel .lf-template-carousel__hint-bottom { margin: 14px 0 0; }

@media screen and (min-width: 750px) {
  .lf-template-carousel .lf-template-carousel__hint-top,
  .lf-template-carousel .lf-template-carousel__hint-bottom { font-size: 16px; }
}

/* ---------- “How it works” strip ---------- */
.crossword-puzzle-generator .lf-how-it-works {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--lf-accent-soft);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 14px;
  line-height: 1.35;
}

@supports (color: color-mix(in srgb, #000 50%, transparent)) {
  .crossword-puzzle-generator .lf-how-it-works {
    border-color: color-mix(in srgb, var(--lf-accent) 18%, transparent);
  }
}

.crossword-puzzle-generator .lf-how-it-works__title { font-weight: 800; margin-bottom: 6px; }
.crossword-puzzle-generator .lf-how-it-works__steps { margin: 0; padding-left: 18px; }
.crossword-puzzle-generator .lf-how-it-works__steps li { margin: 2px 0; }

/* ---------- Solution word tooltip ---------- */
.crossword-puzzle-generator .lf-solution-explainer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(17,17,17,0.75);
}

.crossword-puzzle-generator .lf-solution-explainer button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.10);
  font-weight: 800;
}

.crossword-puzzle-generator .lf-solution-explainer .lf-solution-tip {
  position: static;
  flex-basis: 100%;
  margin-top: 10px;
  width: min(360px, 100%);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,0.14);
}

/* ✅ UI-only solution selection (does NOT affect rendered image) */
#crossword-grid.lf-ui-solution .cell.lf-solution-selected:not(.black-cell) {
  background: rgba(255, 200, 0, 0.45);
}

#crossword-grid.lf-ui-solution .cell.lf-solution-selected:not(.black-cell)::after {
  content: attr(data-solution-n);
  position: absolute;
  right: 2px;
  bottom: 2px;
  font: 700 12px/1 Arial, Helvetica, sans-serif;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  z-index: 5;
  pointer-events: none;
}

/* Bottom action bar (version controls + solution + primary CTA) */
.crossword-puzzle-generator .lf-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 16px auto 10px;
  max-width: 900px;
  width: 100%;
}

.crossword-puzzle-generator .lf-bottom-actions .version-navigation {
  margin: 0;
  width: auto;
  gap: 10px;
}

/* Remove the arrow button borders (keep them button-like) */
.crossword-puzzle-generator .lf-bottom-actions .version-navigation button {
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  border: none;
  box-shadow: var(--shadow-sm);
}

.crossword-puzzle-generator .lf-bottom-actions .version-indicator { padding: 0.6rem 1rem; }

.crossword-puzzle-generator .lf-bottom-actions .lf-solution-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Mobile: make bottom buttons BIG + full-width */
@media (max-width: 768px) {
  .crossword-puzzle-generator .lf-bottom-actions { padding: 0 12px; gap: 10px; }

  .crossword-puzzle-generator .lf-bottom-actions .version-navigation {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .crossword-puzzle-generator .lf-bottom-actions .version-navigation button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding: 14px 16px;
    font-size: 1.1rem;
  }

  .crossword-puzzle-generator .lf-bottom-actions .version-indicator {
    flex: 0 0 auto;
    padding: 12px 10px;
  }

  .crossword-puzzle-generator .lf-bottom-actions .lf-solution-wrap { width: 100%; }

  .crossword-puzzle-generator .lf-bottom-actions #lf-solution-mode-toggle {
    width: 100%;
    min-width: 0;
    min-height: 52px;
  }

  .crossword-puzzle-generator .lf-bottom-actions #saveCrossword {
    width: 100%;
    min-width: 0;
    min-height: 56px;
  }
}

/* Modal scroll lock (prevents page scrolling behind editor) */
body.lf-modal-open { overflow: hidden; }

/* Prevent scroll chaining / rubber-band to the page behind */
.editor-modal,
.product-modal,
.lf-product-modal { overscroll-behavior: contain; }
.lf-product-modal { overflow-x: hidden; }
.lf-product-modal .lf-modal-body{
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
@media (max-width: 480px){
  .lf-product-modal .product-grid{ overflow-x: hidden; }
  .lf-product-modal .product-card{ overflow: hidden; }
}


.editor-modal .editor-content,
.product-modal .modal-content,
.lf-product-modal .lf-modal-body { overscroll-behavior: contain; }

/* Make sure generator doesn't cause sideways scroll */
.crossword-puzzle-generator { overflow-x: hidden; }


/* === LoveFrames: step navigation + drawers (reduces "technical" feel) === */
.crossword-puzzle-generator .lf-stepper{
  display:flex;
  gap: .6rem;
  width: 100%;
  margin: 0 0 1rem 0;
  padding: .75rem;
  border-radius: var(--radius-lg);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.crossword-puzzle-generator .lf-stepper.is-sticky{
  position: sticky;
  top: 0;
  z-index: 30;
}
.crossword-puzzle-generator .lf-step{
  text-decoration: none;
  appearance: none;
  border: 1px solid var(--border-color);
  background: rgba(0,0,0,.03);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  padding: .65rem .8rem;
  font-family: 'lora';
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.1;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  flex: 1 1 auto;
  text-align: center;
}
.crossword-puzzle-generator .lf-step:active{
  transform: translateY(1px);
}

@media (max-width: 768px){
  .crossword-puzzle-generator .lf-stepper{
    padding: .6rem;
    gap: .45rem;
  }
  .crossword-puzzle-generator .lf-step{
    padding: .55rem .6rem;
    font-size: .85rem;
  }
    .lf-builder-pagewidth{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.crossword-puzzle-generator .lf-preview-label{
  font-family: 'lora';
  font-weight: 700;
  text-align:center;
  opacity: .85;
  margin: 0 0 .75rem 0;
}

.crossword-puzzle-generator .lf-preview-placeholder{
  display:none;
  text-align:center;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 16px;
  border-style: dashed;
  padding: 90px 16px;
  background: rgba(255,255,255,.45);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  color: var(--secondary-color);
  font-weight: 600;
  margin: 0 0 1rem 0;
}
.crossword-puzzle-generator:not(.lf-has-words) .crossword-grid-wrapper{ display:none; }
.crossword-puzzle-generator:not(.lf-has-words) .lf-preview-placeholder{ display:block; }
.crossword-puzzle-generator.lf-has-words .lf-preview-placeholder{ display:none; }


/* Advanced dropdown summary: outlined “more options” button */
.crossword-puzzle-generator details.lf-advanced{
  margin-top: 10px;
  width: 100%;
}

.crossword-puzzle-generator details.lf-advanced > summary{
  list-style: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  box-sizing: border-box;

  padding: 12px 14px;
  border-radius: 10px; /* reduce radius so it looks like a distinct step */

  background: linear-gradient(180deg, rgba(142, 140, 140, 0.57) 0%, rgba(0,0,0,0.00) 100%);
  border: 1px solid rgba(0,0,0,.18);
  color: rgba(0,0,0,.82);

  font-weight: 800;
  letter-spacing: .2px;
  position: relative;
}

.crossword-puzzle-generator details.lf-advanced > summary::after{
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .7;
  transition: transform .15s ease;
}

.crossword-puzzle-generator details.lf-advanced[open] > summary::after{
  transform: translateY(-50%) rotate(180deg);
}

.crossword-puzzle-generator details.lf-advanced > summary:hover{
  background: linear-gradient(180deg, rgba(142, 140, 140, 0.57) 0%, rgba(0,0,0,0.00) 100%);
  border-color: rgba(0,0,0,.28);
}

.crossword-puzzle-generator .lf-solution-toggle-wrap{
  width: 100%;
  max-width: 780px;
  margin: .75rem auto 0;
  display:flex;
  flex-direction: column;
  gap: .6rem;
}

.crossword-puzzle-generator #lf-solution-mode-toggle{
  width: 100%;
  min-width: 0;
}
.crossword-puzzle-generator .lf-solution-explainer{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .9rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--lf-accent) 25%, transparent);
  background: color-mix(in srgb, var(--lf-accent) 5%, transparent);
  color: var(--primary-color);
}
.crossword-puzzle-generator .lf-solution-explainer strong{
  font-family: 'lora';
}
.crossword-puzzle-generator .lf-solution-tip-details{
  position: relative;
}
.crossword-puzzle-generator .lf-solution-tip-details > summary{
  list-style: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid color-mix(in srgb, var(--lf-accent) 35%, transparent);
  background: rgba(0,0,0,.03);
  color: var(--lf-accent);
  font-weight: 900;
}
.crossword-puzzle-generator .lf-solution-tip-details > summary::-webkit-details-marker{ display:none; }
.crossword-puzzle-generator .lf-solution-tip{
  position:absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  width: min(320px, 80vw);
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  box-shadow: var(--shadow-md);
  color: var(--primary-color);
}



/* Hide specific blocks until 7 answers are filled */
.crossword-puzzle-generator .lf-hidden-until-7{ display:none; }
.crossword-puzzle-generator.lf-has-7 .lf-hidden-until-7{
  display:block;
  animation: lfFadeUp .18s ease both;
}

/* Warnings/feedback: make it feel intentional above extras */
.crossword-puzzle-generator .warnings-container{ margin: 12px auto 10px; }
