/* assets/css/main.css - Global styles and design tokens for Romantic Prints */
:root {
  color-scheme: light;

  --bg: #FAF7F5;
  --surface: #FFFFFF;
  --surface-2: #fff3f3;

  --border: #E8E0D8;
  --border-hover: rgba(186, 0, 0, 0.6);
  --border-strong: #D4C8BC;

  --gold: #BA0000;
  --gold-light: #9A0000;
  --gold-dim: #F5E8E8;
  --gold-glow: rgba(186, 0, 0, 0.12);
  --accent-mid: #D4A0A0;

  --text: #1E1410;
  --text-soft: #8A7A70;
  --text-muted: #8A7A70;
  --text-faint: #B8A89C;

  --error: #C86E6E;
  --success: #4A7A4A;
  --success-bg: #EDF2ED;

  --space-1: 4px;
  --space-1_5: 6px;
  --space-2: 8px;
  --space-2_5: 10px;
  --space-3: 12px;
  --space-4: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-xl: 28px;
  --radius-pill: 20px;

  --shadow-sm: 0 1px 4px rgba(30, 10, 8, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 10, 8, 0.08);
  --shadow-lg: 0 8px 40px rgba(30, 10, 8, 0.12);
  --shadow-card: 0 2px 12px rgba(186, 0, 0, 0.06);
  --shadow-elevated: var(--shadow-lg);
  --shadow-gold: 0 0 0 3px rgba(186, 0, 0, 0.12);
  --shadow-xl: var(--shadow-lg);

  --header-bg: rgba(255, 255, 255, 0.94);
  --header-bg-strong: rgba(255, 255, 255, 0.98);
  --footer-bg: #1A0E0E;
  --overlay-bg: rgba(30, 10, 8, 0.24);
  --surface-overlay: rgba(255, 255, 255, 0.92);
  --grain-opacity: 0.04;
  --orb-1: rgba(186, 0, 0, 0.04);
  --orb-2: rgba(186, 0, 0, 0.03);
  --panel-soft: #fbfbfb;
  --panel-softer: rgba(245, 240, 236, 0.72);
  --panel-strong: rgba(212, 160, 160, 0.16);
  --input-bg: #fbfbfb;
  --input-focus-bg: #FFFFFF;
  --surface-grad-top: rgba(245, 240, 236, 0.55);
  --surface-grad-bottom: rgba(255, 255, 255, 0.94);

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

html[data-theme='dark'] {
  color-scheme: dark;

  --bg: #1A0E0E;
  --surface: #2A1414;
  --surface-2: #341C1C;

  --border: rgba(240, 234, 228, 0.14);
  --border-hover: rgba(186, 0, 0, 0.7);
  --border-strong: rgba(240, 234, 228, 0.24);

  --gold: #BA0000;
  --gold-light: #D12D2D;
  --gold-dim: rgba(186, 0, 0, 0.14);
  --gold-glow: rgba(186, 0, 0, 0.2);
  --accent-mid: #B67E7E;

  --text: #F0EAE4;
  --text-soft: #D8CCC1;
  --text-muted: #B8A09A;
  --text-faint: #9D8A81;

  --shadow-sm: 0 1px 4px rgba(30, 10, 8, 0.18);
  --shadow-md: 0 4px 16px rgba(30, 10, 8, 0.22);
  --shadow-lg: 0 8px 40px rgba(30, 10, 8, 0.28);
  --shadow-card: 0 2px 12px rgba(186, 0, 0, 0.12);
  --shadow-elevated: var(--shadow-lg);
  --shadow-gold: 0 0 0 3px rgba(186, 0, 0, 0.16);
  --shadow-xl: var(--shadow-lg);

  --header-bg: rgba(26, 14, 14, 0.94);
  --header-bg-strong: rgba(26, 14, 14, 0.98);
  --footer-bg: #1A0E0E;
  --overlay-bg: rgba(30, 10, 8, 0.44);
  --surface-overlay: rgba(42, 20, 20, 0.9);
  --grain-opacity: 0.18;
  --orb-1: rgba(186, 0, 0, 0.08);
  --orb-2: rgba(186, 0, 0, 0.04);
  --panel-soft: rgba(240, 234, 228, 0.04);
  --panel-softer: rgba(240, 234, 228, 0.03);
  --panel-strong: rgba(186, 0, 0, 0.14);
  --input-bg: rgba(240, 234, 228, 0.05);
  --input-focus-bg: rgba(255, 255, 255, 0.08);
  --surface-grad-top: rgba(240, 234, 228, 0.04);
  --surface-grad-bottom: rgba(240, 234, 228, 0.01);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
}

body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: var(--grain-opacity);
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

main,
header,
footer,
section,
div {
  position: relative;
  z-index: 0;
}

.container {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
}

.main-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.main-nav a {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: var(--transition);
}

.main-nav a:hover {
  color: var(--gold-light);
  border-color: rgba(186, 0, 0, 0.35);
}

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  z-index: -1 !important;
}

.footer-wrap {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-wrap p {
  margin: 0;
  color: #B8A09A;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.footer-wrap a {
  color: #F0EAE4;
  transition: color var(--transition);
}

.footer-wrap a:hover {
  color: var(--gold);
}

.hero {
  padding: 64px 0 40px;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.hero p {
  margin: 0;
  max-width: 640px;
  color: var(--text-soft);
  font-size: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0 44px;
}

.tool-card {
  background: linear-gradient(180deg, var(--surface-grad-top), var(--surface-grad-bottom));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.tool-card h3 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
}

.tool-card p {
  margin: 0 0 16px;
  color: var(--text-soft);
  min-height: 56px;
}

.notice {
  background: rgba(200, 110, 110, 0.1);
  border: 1px solid rgba(200, 110, 110, 0.3);
  color: #925858;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(186, 0, 0, 0.22);
  background: var(--gold-dim);
  color: var(--gold);
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--gold);
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(186, 0, 0, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(186, 0, 0, 0.18);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(186, 0, 0, 0.18);
}

.btn.secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--gold-light);
  box-shadow: 0 4px 16px rgba(186, 0, 0, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 13px;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--gold);
  background: transparent;
  color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.input-field {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 13px;
  width: 100%;
  transition: var(--transition);
  outline: none;
}

.input,
select,
textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 13px;
  width: 100%;
  transition: var(--transition);
  outline: none;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px rgba(186, 0, 0, 0.12);
}

.input-field::placeholder {
  color: var(--text-faint);
}

.input-field:focus {
  border-color: var(--gold);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px rgba(186, 0, 0, 0.12);
}

.input-field.error {
  border-color: var(--error);
}

.field-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

@media (max-width: 900px) {
  .main-nav {
    gap: 12px;
    overflow-x: auto;
    max-width: 64vw;
  }

  .main-nav a {
    font-size: 11px;
    white-space: nowrap;
  }

  .brand {
    font-size: 25px;
  }

  .footer-wrap {
    padding: 14px 0;
  }
}

/* HEADER */

.site-header {
  position: relative;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
}

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

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.site-logo em {
  font-style: normal;
  color: var(--gold);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 84px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--gold);
}

.theme-toggle-icon {
  font-size: 13px;
  line-height: 1;
}

.theme-toggle-mobile {
  margin-bottom: 12px;
  min-width: 100%;
}

.nav-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  padding: 4px 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.hamburger:hover {
  background: var(--panel-soft);
}

.ham-line {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-soft);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

.ham-line.open:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.ham-line.open:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.ham-line.open:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-menu {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 0 24px;
  z-index: 99;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-soft);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-bottom: 1px solid var(--border);
}

.mobile-nav-link:last-child {
  border-bottom: none;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: var(--gold-dim);
  color: var(--gold);
}

.mobile-nav-icon {
  color: var(--gold);
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.mobile-nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
}

.mobile-nav-badge.soon {
  background: var(--panel-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

.mobile-menu-footer {
  padding: 16px 24px 0;
}

.mobile-menu-tagline {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 98;
  backdrop-filter: blur(2px);
}

.menu-enter {
  transition: all 0.25s ease;
}

.menu-enter-start {
  opacity: 0;
  transform: translateY(-8px);
}

.menu-enter-end {
  opacity: 1;
  transform: translateY(0);
}

.menu-leave {
  transition: all 0.2s ease;
}

.menu-leave-start {
  opacity: 1;
  transform: translateY(0);
}

.menu-leave-end {
  opacity: 0;
  transform: translateY(-8px);
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .theme-toggle {
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-sm);
    letter-spacing: 0;
  }

  .theme-toggle-text {
    display: none;
  }

  .theme-toggle-mobile {
    min-width: 100%;
    height: 40px;
    border-radius: var(--radius);
    justify-content: center;
    gap: 8px;
  }

  .theme-toggle-mobile .theme-toggle-text {
    display: inline;
  }
}

/* MOBILE GLOBAL RESETS */

html,
body {
  overflow-x: visible;
  -webkit-text-size-adjust: 100%;
}

input,
select,
textarea {
  font-size: 16px !important;
}

* {
  -webkit-tap-highlight-color: rgba(186, 0, 0, 0.15);
}

a {
    min-height: 0px !important;
}

button,
a,
[role="button"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* POSTER TOOL MOBILE */

.builder {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
  align-items: start;
}

.preview-panel {
  position: sticky;
  top: 25px;
  align-self: start;
  z-index: 12;
}

@media (max-width: 960px) {
  .builder {
    grid-template-columns: 1fr;
    padding: 0 16px 60px;
  }

  .preview-panel {
    order: -1;
    top: 0px;
    background: var(--bg);
    padding-bottom: 12px;
    border-bottom: 0px solid var(--border);
  }

  .form-panel {
    order: 1;
  }
}

@media (max-width: 600px) {
  .builder {
    gap: 20px;
    padding: 0 16px 100px;
  }

  .poster-wrap {
    max-width: 320px;
    margin: 0 auto;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .stat-val {
    font-size: 18px;
  }

  .stat-key {
    font-size: 8px;
  }

  .form-section {
    margin-bottom: 20px;
  }

  .field-row.two-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .theme-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .theme-btn {
    padding: 8px 4px;
  }

  .theme-name {
    display: none;
  }

  .style-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .style-opt {
    padding: 12px 6px;
  }

  .provider-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .provider-btn {
    padding: 12px 10px;
    font-size: 12px;
  }
}

/* FLOATING MOBILE CTA */

@media (max-width: 768px) {
  .mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--header-bg-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 50;
    display: flex;
    gap: 5px;
    align-items: center;
  }

  .mobile-cta-bar .btn-primary {
    flex: 1;
    font-size: 16px;
    padding: 14px 5px;
  }

  .mobile-cta-bar .btn-ghost {
    flex-shrink: 0;
    padding: 14px 16px;
    font-size: 12px;
  }

  .cta-area {
    display: none;
  }
}

@media (min-width: 769px) {
  .mobile-cta-bar {
    display: none;
  }

  .cta-area {
    display: block;
  }
}

/* HERO SECTION MOBILE */

@media (max-width: 600px) {
  .poster-hero {
    padding: 30px 24px 10px;
  }

  .hero-title {
    font-size: clamp(32px, 9vw, 52px);
  }

  .hero-sub {
    font-size: 15px;
  }
}

/* HOMEPAGE TOOLS GRID MOBILE */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

@media (max-width: 600px) {
  .tools-grid {
    grid-template-columns: 1fr;
    padding: 0 16px 60px;
    gap: 12px;
  }
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), transform var(--transition);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card:hover {
  border-color: rgba(186, 0, 0, 0.6);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .tool-card {
    padding: 20px;
  }

  .tool-card:hover {
    transform: none;
  }
}

/* SUCCESS PAGE MOBILE */

@media (max-width: 600px) {
  .success-state {
    padding: 32px 20px;
  }

  .success-poster-wrap {
    max-width: 300px;
    margin: 0 auto;
  }

  .btn-download {
    width: 100%;
    font-size: 15px;
  }
}

/* ADMIN MOBILE */

.admin-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

@media (max-width: 600px) {
  .admin-container {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 500px;
  }

  .fields-grid {
    grid-template-columns: 1fr !important;
  }

  .settings-card-header {
    padding: 16px;
  }

  .settings-card-body {
    padding: 0 16px 20px;
  }
}

/* GENERAL CONTAINER */

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 600px) {
  .page-container {
    padding: 0 16px;
  }
}

/* TYPOGRAPHY MOBILE */

@media (max-width: 600px) {
  .page-title {
    font-size: 28px !important;
  }
}

/* MAP POSTER */

.map-canvas-wrap {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
.preview-panel .map-canvas-wrap, .preview-lightbox .map-canvas-wrap {
    --frame-size: 10px !important;
}
}

@media (max-width: 900px) {
.preview-panel .map-canvas-wrap, .preview-lightbox .map-canvas-wrap {
    --frame-size: 14px !important;
}
}

.preview-panel .map-canvas-wrap,
.preview-lightbox .map-canvas-wrap {
  --frame-size: 20px;
  --frame-pad: 15px;
  --frame-top: #e5e4df;
  --frame-bottom: #cdcdc6;
  --frame-edge-top: #2f2d2d;
  --frame-edge-right: #434040;
  --frame-edge-bottom: #4f4c4c;
  --frame-edge-left: #434040;
  --window-border-top: #bbbab4;
  --window-border-right: #c7c7bf;
  --window-border-bottom: #e5e4df;
  --window-border-left: #c7c7bf;
  margin: 0 auto;
  border-radius: 0;
  border-style: solid;
  border-width: var(--frame-size);
  border-color: var(--frame-edge-top) var(--frame-edge-right) var(--frame-edge-bottom) var(--frame-edge-left);
  /*padding: var(--frame-pad);*/
  padding: 0px !important;
  background: linear-gradient(var(--frame-top), var(--frame-bottom));
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.55),
    0 5px 2px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.45);
}

.preview-panel .map-canvas-wrap::before,
.preview-lightbox .map-canvas-wrap::before {
  content: '';
  position: absolute;
  top: -175px;
  right: -20%;
  width: 400px;
  height: 400px;
  transform: rotate(-40deg);
  background: linear-gradient(rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 3;
}

.preview-panel .map-frame-window,
.preview-lightbox .map-frame-window {
  position: relative;
  width: 100%;
  border-style: solid;
  border-width: 2px;
  border-color: var(--window-border-top) var(--window-border-right) var(--window-border-bottom) var(--window-border-left);
  background: #f5f5f5;
  box-shadow:
    0 -1px 1px rgba(0, 0, 0, 0.1),
    0 1px 1px 1px rgba(255, 255, 255, 0.65);
  overflow: hidden;
  border-radius: 0;
}

.preview-panel .map-canvas-wrap.frame-none,
.preview-lightbox .map-canvas-wrap.frame-none {
  --frame-size: 1px;
  --frame-pad: 0;
  border-style: solid;
  border-width: var(--frame-size);
  border-color: var(--border);
  background: var(--surface);
  box-shadow:
    0 24px 40px rgba(15, 23, 42, 0.2),
    0 8px 20px rgba(15, 23, 42, 0.1);
}

.preview-panel .map-canvas-wrap.frame-none::before,
.preview-lightbox .map-canvas-wrap.frame-none::before {
  display: none;
}

.preview-panel .map-canvas-wrap.frame-none .map-frame-window,
.preview-lightbox .map-canvas-wrap.frame-none .map-frame-window {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.preview-panel .map-canvas-wrap.frame-white,
.preview-lightbox .map-canvas-wrap.frame-white {
  --frame-top: #f6f6f2;
  --frame-bottom: #ddddda;
  --frame-edge-top: #f0f0ec;
  --frame-edge-right: #d6d6d2;
  --frame-edge-bottom: #c2c3be;
  --frame-edge-left: #ddddda;
  --window-border-top: #d8d8d3;
  --window-border-right: #e6e6e1;
  --window-border-bottom: #f6f6f1;
  --window-border-left: #e3e3de;
}

.preview-panel .map-canvas-wrap.frame-black,
.preview-lightbox .map-canvas-wrap.frame-black {
  --frame-top: #35383d;
  --frame-bottom: #1c1f24;
  --frame-edge-top: #1b1d21;
  --frame-edge-right: #2f3237;
  --frame-edge-bottom: #080a0d;
  --frame-edge-left: #2b2e33;
  --window-border-top: #474b52;
  --window-border-right: #5c6169;
  --window-border-bottom: #7a8089;
  --window-border-left: #5c6169;
}

.preview-panel .map-canvas-wrap.frame-wood,
.preview-lightbox .map-canvas-wrap.frame-wood {
  --frame-top: #eadcc4;
  --frame-bottom: #d0bc98;
  --frame-edge-top: #cfb086;
  --frame-edge-right: #e0c59d;
  --frame-edge-bottom: #ae8e64;
  --frame-edge-left: #dbc198;
  --window-border-top: #ddd0bc;
  --window-border-right: #ebe1d3;
  --window-border-bottom: #f6efe6;
  --window-border-left: #e5d9c8;
}

.preview-panel .map-canvas-wrap.frame-darkwood,
.preview-lightbox .map-canvas-wrap.frame-darkwood {
  --frame-top: #83674a;
  --frame-bottom: #614830;
  --frame-edge-top: #654a30;
  --frame-edge-right: #7a5d3f;
  --frame-edge-bottom: #493521;
  --frame-edge-left: #76583b;
  --window-border-top: #b59d80;
  --window-border-right: #c6b195;
  --window-border-bottom: #dbcbb7;
  --window-border-left: #c3ad91;
}

.map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0 !important;
}

.poster-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.10) 14%,
      rgba(255, 255, 255, 0.03) 32%,
      rgba(255, 255, 255, 0) 60%
    ),
    radial-gradient(
      130% 52% at 50% -8%,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0) 65%
    );
  opacity: 0.36;
  mix-blend-mode: soft-light;
}

.preview-panel .map-canvas-wrap.frame-none .poster-gloss,
.preview-lightbox .map-canvas-wrap.frame-none .poster-gloss {
  opacity: 0.28;
}

.preview-expand-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(12, 18, 30, 0.72);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  z-index: 5;
  transition: var(--transition);
}

.preview-expand-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(12, 18, 30, 0.9);
}

.preview-expand-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.preview-lightbox-open {
  overflow: hidden;
}

.preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(10px);
  overscroll-behavior: contain;
}

.preview-lightbox-dialog {
  width: min(94vw, 1120px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}

.preview-lightbox-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.preview-lightbox-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(30, 10, 8, 0.45);
  color: rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.preview-lightbox-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.preview-lightbox .map-canvas-wrap {
  --lb-aspect: 0.8;
  width: min(92vw, calc((94vh - 110px) * var(--lb-aspect)));
  max-height: none;
}

.map-lightbox-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  touch-action: pinch-zoom;
}

@media (max-width: 700px) {
  .preview-lightbox {
    padding: 14px;
    backdrop-filter: none;
    background: rgba(8, 10, 16, 0.94);
  }

  .preview-lightbox-dialog {
    width: 100%;
  }

  .preview-lightbox .map-canvas-wrap {
    width: min(100%, calc((92vh - 90px) * var(--lb-aspect)));
    max-height: none;
  }

  .preview-lightbox-close {
    right: 0;
  }

  .preview-lightbox .poster-gloss {
    display: none;
  }
}

.canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.3;
}

.canvas-placeholder p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.canvas-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--surface-overlay);
  backdrop-filter: blur(4px);
}

.canvas-loading p {
  color: var(--text-muted);
  font-size: 13px;
}

.lookup-status,
.lookup-success,
.lookup-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}

.lookup-status {
  background: var(--panel-soft);
  color: var(--text-muted);
}

.lookup-success {
  background: var(--success-bg);
  border: 1px solid #C8DCC8;
  color: var(--success);
}

.lookup-error {
  background: rgba(232, 112, 112, 0.08);
  border: 1px solid rgba(232, 112, 112, 0.2);
  color: var(--error);
}

.check-green {
  color: var(--success);
  font-weight: 700;
}

.distance-badge {
  display: none !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.dist-val {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 900;
    color: #000000;
}

.dist-sep {
  opacity: 0.4;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 400px) {
  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .preview-panel {
    top: 0px;
  }
}

/* MAP POSTER V2: FONT PICKER */

.font-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.font-btn {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  min-height: 70px;
}

.font-btn:hover {
  border-color: var(--border-hover);
}

.font-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.font-preview {
  font-size: 22px;
  color: var(--text);
  line-height: 1.2;
}

.font-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* MAP POSTER V2: SIZE PICKER */

.size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 400px) {
  .size-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.size-btn {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  position: relative;
}

.size-btn:hover {
  border-color: var(--border-hover);
}

.size-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.size-visual-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-visual {
  background: var(--panel-strong);
  border: 1px solid var(--border-hover);
  border-radius: 2px;
  min-width: 14px;
  min-height: 14px;
}

.size-btn.active .size-visual {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.size-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}

.size-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.size-info {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px;
  background: var(--panel-softer);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* MAP POSTER V2: FRAME PICKER */

.frame-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 400px) {
  .frame-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.frame-btn {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.frame-btn:hover {
  border-color: var(--border-hover);
}

.frame-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.frame-swatch-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-swatch-inner {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.frame-swatch-none {
  background: transparent;
}

.frame-swatch-white {
  border: 6px solid #f2f2ef;
  background: #fafaf7;
  box-shadow:
    inset 0 0 0 2px rgba(198, 198, 194, 0.85),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.frame-swatch-wood {
  border: 6px solid #decaa9;
  background:
    linear-gradient(145deg, #eadcc2, #d2bc96),
    repeating-linear-gradient(90deg, rgba(132, 103, 64, 0.10) 0 1px, rgba(255, 255, 255, 0) 1px 3px);
  box-shadow:
    inset 0 0 0 2px rgba(171, 140, 96, 0.55),
    inset 0 1px 2px rgba(255, 255, 255, 0.32);
}

.frame-swatch-black {
  border: 6px solid #26282d;
  background: linear-gradient(145deg, #34373d, #17191d);
  box-shadow:
    inset 0 0 0 2px rgba(102, 108, 118, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.06);
}

.frame-swatch-darkwood {
  border: 6px solid #73583e;
  background:
    linear-gradient(145deg, #84664a, #5c432d),
    repeating-linear-gradient(90deg, rgba(42, 26, 13, 0.14) 0 1px, rgba(255, 255, 255, 0) 1px 3px);
  box-shadow:
    inset 0 0 0 2px rgba(81, 58, 34, 0.55),
    inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

.frame-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
}

.frame-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

.preview-panel .map-canvas-wrap {
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

/* MAP POSTER ORIENTATION TOGGLE */

.orientation-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.orient-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.orient-btn:hover {
  border-color: var(--border-hover);
}

.orient-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.orient-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-rect {
  width: 22px;
  height: 32px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: 0.6;
}

.orient-btn.active .portrait-rect {
  opacity: 1;
}

.landscape-rect {
  width: 34px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: 0.6;
}

.orient-btn.active .landscape-rect {
  opacity: 1;
}

.orient-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  font-family: 'DM Sans', sans-serif;
}

/* MAP POSTER LAYOUT TOGGLE */

.layout-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.layout-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.layout-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-soft);
}

.layout-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}

.layout-label {
  font-size: 12px;
  font-weight: 500;
  color: inherit;
}

.layout-desc {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.order-recap-grid div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px !important;
}
.ql-snow.ql-toolbar button svg, .ql-snow .ql-toolbar button svg {
  height: 20px !important;
}

.ql-snow .ql-picker-label {
      display: contents !important;
}

.clr-field button {
    position: relative !important;
    width: 100% !important;
    height: 15px !important;
    min-height: 15px !important;
    right: 0;
    top: 0;
    transform: translateY(8%) !important;
    border-radius: 5px;
}

.clr-field {
    width: 100% !important;
}
