*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-dark: #16463F;
  --primary-light: #2A6B5E;
  --accent-gold: #C9A66B;
  --accent-gold-light: #DDC9A0;
  --bg-warm: #EDE6D6;
  --card-bg: #FBF8F1;
  --border-light: #DDD3BD;
  --text-dark: #2B2B27;
  --text-muted: #6B6660;
  --danger: #C0392B;
  --urgent-action: #CC5B33;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius-md: 12px;
  --radius-lg: 20px;
  --navbar-h: 64px;
}

*:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}
.tag-swatch:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}
.mob-bar-btn-generate:focus-visible,
.mob-bar-dl:focus-visible,
.mob-bar-edit:focus-visible,
.mob-bar-reset:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .toast {
    transition: none;
  }
}

html {
  background: var(--bg-warm);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-warm);
  color: var(--text-dark);
  line-height: 1.5;
  padding-top: var(--navbar-h);
}

/* LAYOUT */
.app-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 12px auto;
  padding: 0 16px 48px;
}
@media (min-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr 360px;
  }
}

/* CARDS */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 18px;
  margin-bottom: 16px;
  border: 0.5px solid var(--border-light);
}
.card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--accent-gold);
  padding-left: 12px;
}
.card h2 i {
  font-size: 1.2rem;
  color: var(--accent-gold);
}

/* FORMS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label, legend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.required-star {
  color: var(--danger);
  margin-left: 2px;
}
.field input, .field select, .field textarea {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.9rem;
  background: white;
  transition: border 0.2s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(201,166,107,0.2);
}
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.err {
  font-size: 0.78rem;
  color: var(--danger);
  display: none;
  line-height: 1.5;
}
.field.invalid input, .field.invalid select {
  border-color: var(--danger);
}
.field.invalid .err {
  display: block;
}

/* BORDERLESS FIELDSET – single unified class */
.bare-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-inline-size: auto;
  display: block;
}
.bare-fieldset legend {
  float: none;
  width: auto;
  margin-bottom: 6px;
  padding: 0;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
  padding: 4px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.field.invalid .radio-group {
  border-left-color: var(--danger);
  background: #fef2f0;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  cursor: pointer;
}
.radio-group input[type="radio"] {
  accent-color: var(--primary-dark);
  width: 16px;
  height: 16px;
}

.phone-row {
  display: flex;
  gap: 8px;
}
.phone-row select {
  width: 110px;
}
.combo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.combo-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 90px;
}
.combo-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.combo-row select {
  width: 100%;
}

.color-message {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* SWATCH ROW */
.swatch-wrapper {
  position: relative;
}
.swatch-row {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold) transparent;
}
.swatch-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent 0%, var(--card-bg) 85%);
  pointer-events: none;
  border-radius: 0 0 8px 8px;
  transition: opacity 0.2s;
}
.swatch-wrapper.at-bottom::after {
  opacity: 0;
}
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 8px;
  justify-content: flex-start;
  max-height: 110px;
  overflow-y: auto;
  padding: 4px 2px;
}
.tag-swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tag-swatch i {
  font-size: 18px;
  color: #5a4a2a;
  text-shadow: 0 0 1px white;
}
.tag-swatch.selected {
  border: 2px solid var(--accent-gold);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.swatch-default {
  background: linear-gradient(145deg, #e0e0e0, #b0b0b0);
}
.swatch-default i {
  color: #3a3a3a;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: var(--primary-dark);
  color: white;
  border: 1px solid var(--accent-gold);
}
.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}
.btn-outline {
  background: rgba(22, 70, 63, 0.06);
  border: 1.5px solid var(--primary-dark);
  color: var(--primary-dark);
}
.btn-outline:hover {
  background: rgba(22, 70, 63, 0.12);
}
/* Download buttons */
.btn-download {
  background: var(--border-light);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  cursor: not-allowed;
  opacity: 0.6;
}
.btn-download:enabled {
  background: var(--primary-light);
  color: var(--card-bg);
  border: 1px solid var(--accent-gold);
  cursor: pointer;
  opacity: 1;
}
.btn-download:enabled:hover {
  background: #1e5549;
  transform: translateY(-1px);
}
.btn-download:enabled:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.dl-section .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.dl-section .btn {
  min-width: 118px;
  flex: 1 1 118px;
}
/* PDF is the hero CTA */
.dl-section .btn[data-primary-dl] {
  flex: 2 1 100%;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 20px;
  background: var(--primary-dark);
  color: var(--accent-gold);
  border: 1.5px solid var(--accent-gold);
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  order: -1;
}
.dl-section .btn[data-primary-dl]:hover:not(:disabled) {
  background: #1e5c42;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}
.dl-section .btn[data-primary-dl]:disabled {
  opacity: 0.4;
}

/* PREVIEW CARD */
.preview-card {
  text-align: center;
  position: sticky;
  top: calc(var(--navbar-h) + 10px);
}
.preview-canvases {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 12px 0;
}
.preview-block {
  flex: 1;
  min-width: 130px;
}
.preview-block h3 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  text-align: center;
}
#tagCanvasFront, #tagCanvasBack {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}
/* Canvas pop-in on generate */
#tagCanvasFront.tag-popin, #tagCanvasBack.tag-popin {
  animation: tagPopin 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes tagPopin {
  0%   { transform: scale(0.82); opacity: 0.4; }
  100% { transform: scale(1);    opacity: 1; }
}
/* Skeleton canvas placeholder */
.canvas-skeleton {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-warm) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Success banner */
.tag-success-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #1b5e40 0%, #16463F 100%);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 12px;
  animation: bannerSlideIn 0.4s cubic-bezier(0.34,1.2,0.64,1) both;
}
.tag-success-banner.visible {
  display: flex;
}
@keyframes bannerSlideIn {
  0%   { transform: translateY(-8px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
.tag-success-banner i {
  color: var(--accent-gold);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.tag-success-banner span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #DDC9A0;
}
.tag-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.dl-section {
  margin-top: 16px;
  width: 100%;
}

/* PROFILE PREVIEW LINK */
#previewLinkContainer {
  background: #F5EBD8;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  border: 0.5px solid var(--accent-gold);
  margin-top: 8px;
}
#previewLinkContainer a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#previewLinkContainer a:hover {
  color: var(--accent-gold);
}

/* APPEARANCE GRID */
.appearance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.appearance-grid .full {
  grid-column: 1 / -1;
}
.color-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.color-field input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: white;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: white;
  padding: 10px 20px;
  border-radius: 40px;
  font-size: 0.8rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
@media (min-width: 601px) {
  .toast {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
.toast.show {
  opacity: 1;
}
.toast.toast-success {
  background: #1e7d52;
}
.toast.toast-error {
  background: #991b1b;
}
@media (max-width: 600px) {
  .toast { white-space: normal; max-width: 90%; text-align: center; }
}

/* PRIVACY WARNINGS */
.privacy-warning {
  font-size: 0.78rem;
  color: #7a5c00;
  background: #fdf8e8;
  border: 1px solid #f0d070;
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 6px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}
.privacy-note-small {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* LASER MODAL */
.laser-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}
.laser-modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 24px;
  border: 0.5px solid var(--accent-gold);
  box-shadow: var(--shadow-md);
}
.laser-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.laser-modal-icon {
  font-size: 28px;
}
.laser-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}
.laser-modal-text {
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.5;
}
.laser-modal-list {
  margin: 0 0 16px 20px;
  font-size: 0.85rem;
  color: var(--text-dark);
}
.laser-modal-warning {
  background: #FEF3C7;
  border-left: 3px solid var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: #92400E;
}
.laser-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.laser-modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 500;
}
.laser-modal-btn-confirm {
  background: var(--primary-dark);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 600;
}
.laser-modal-btn-confirm:hover {
  background: var(--primary-light);
}

/* SITE FOOTER */
.site-footer {
  background: var(--primary-dark);
  color: var(--accent-gold);
  padding: 32px 20px 24px;
  margin-top: 0;
  border-top: 1px solid rgba(201, 166, 107, 0.25);
  font-size: 0.9rem;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.footer-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.5;
}

.footer-line span,
.footer-line a {
  color: var(--accent-gold);
  text-decoration: none;
}

.footer-line a:hover {
  opacity: 0.8;
  text-decoration: none;
}

.footer-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(69%) sepia(39%) saturate(589%) hue-rotate(0deg) brightness(96%) contrast(93%);
}

.footer-line i {
  color: var(--accent-gold);
  font-size: 1rem;
}

.footer-copyright {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  width: 100%;
  max-width: 500px;
}
.footer-tagline {
  font-size: 0.8rem;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .site-footer {
    padding: 28px 16px 20px;
  }
  .footer-line {
    gap: 6px;
    text-align: center;
  }
  .footer-icon {
    width: 18px;
    height: 18px;
  }
}

/* RESET / UTILS */
.hidden {
  display: none !important;
}
.nfc-hidden { display: none !important; }
.nfc-info-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.4;
}
.nfc-info-note i { flex-shrink: 0; margin-top: 1px; font-size: 0.8rem; color: #9ca3af; }

/* KO-FI */
.kofi-nudge {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(201, 166, 107, 0.08);
  border: 1px solid rgba(201, 166, 107, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .kofi-nudge { display: none; }
}
.kofi-nudge span {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}
.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #FF5E5B;
  color: #fff !important;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.btn-kofi:hover { opacity: 0.88; }
.footer-kofi {
  margin-top: 6px;
  justify-content: center;
}
.footer-kofi a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FF5E5B;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-kofi a:hover { opacity: 0.8; }
.mob-bar-kofi {
  color: #FF5E5B !important;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 1 !important;
}
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--border-light);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 4px;
}

/* ===============================
   PILL NAVBAR (green pill, gold text)
   =============================== */

.vn-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: transparent;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.vn-left {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 8px 20px 8px 16px;
  border-radius: 9999px;
  background: rgba(22, 70, 63, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vn-navbar[data-scrolled="true"] .vn-left {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vn-navbar[data-page="profile"] .vn-left,
.vn-navbar[data-page="profile"] .vn-right {
  background: rgba(22, 70, 63, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 9999px;
  padding: 8px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vn-logo-img {
  width: 38px;
  height: 38px;
  display: block;
}

.vn-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.vn-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #C9A66B;
}

.vn-tagline {
  font-size: 0.7rem;
  font-weight: 500;
  color: #DDC9A0;
  opacity: 0.9;
}

/* Auto-save badge */
.auto-save-badge {
  font-size: 0.65rem;
  color: var(--accent-gold);
  background: rgba(201,166,107,0.15);
  padding: 2px 10px;
  border-radius: 30px;
  border: 1px solid rgba(201,166,107,0.3);
  white-space: nowrap;
  margin-left: 6px;
  transition: opacity 0.2s;
}

.vn-right {
  display: flex;
  align-items: center;
  gap: 22px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  background: rgba(22, 70, 63, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 9999px;
  padding: 8px 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vn-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: #DDC9A0;
  text-decoration: none;
  padding: 6px 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.vn-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Active link indicator – non-colour cue */
.vn-link-active {
  color: #ffffff !important;
  border-bottom: 2px solid #ffffff;
  padding-bottom: 4px;
}

.vn-right-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vn-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--primary-dark);
  font-size: 1.4rem;
  line-height: 1;
  transition: opacity 0.2s, color 0.3s ease;
  z-index: 1001;
}
.vn-hamburger:hover { opacity: 0.75; }
.vn-hamburger.hidden {
  display: none !important;
}

/* When HIW section is in view, hamburger reverts to light gold (dark bg context) */
body.hiw-mode .vn-hamburger {
  color: var(--accent-gold-light);
}

/* Mobile drawer */
.vn-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1100; /* must sit above .vn-navbar (1000) or the close button is unclickable */
}
.vn-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.vn-drawer-panel {
  position: absolute;
  top: 0; right: 0;
  width: 220px;
  height: 100%;
  background: #16463F;
  border-left: 1px solid rgba(201, 166, 107, 0.25);
  display: flex;
  flex-direction: column;
  padding: 80px 24px 32px;
  gap: 8px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
}
.vn-drawer.open { display: block; }
.vn-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #DDC9A0;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 166, 107, 0.15);
  transition: opacity 0.2s;
}
.vn-drawer-link:last-child { border-bottom: none; }
.vn-drawer-link:hover { opacity: 0.8; }
.vn-drawer-link i { font-size: 1.1rem; }

/* Responsive: on narrow screens, show hamburger, hide right links */
@media (max-width: 700px) {
  body {
    padding-top: var(--navbar-h);
  }
  .vn-navbar {
    padding: 12px 16px;
  }
  .vn-right {
    display: none;
  }
  .vn-hamburger {
    display: flex;
    align-items: center;
  }
  .vn-left {
    padding: 6px 14px;
  }
  .vn-brand-name {
    font-size: 1rem;
  }
  .vn-tagline {
    font-size: 0.6rem;
  }
}

/* ===============================
   DRAWER CLOSE BUTTON (consolidated)
   =============================== */
.vn-drawer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(201, 166, 107, 0.15);
  border: 1px solid rgba(201, 166, 107, 0.35);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #DDC9A0;
  font-size: 1rem;
  transition: background 0.2s;
}
.vn-drawer-close:hover {
  background: rgba(201, 166, 107, 0.28);
}

/* ===============================
   HOW IT WORKS SECTION
   =============================== */

.hiw-section {
  background: var(--primary-dark);
  padding: 72px 20px 80px;
  margin-top: 0;
  scroll-margin-top: var(--navbar-h);
}

.hiw-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hiw-header {
  text-align: center;
  margin-bottom: 56px;
}

.hiw-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent-gold);
  margin-bottom: 12px;
  opacity: 0.85;
}

.hiw-title {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  font-family: 'Playfair Display', Georgia, serif;
}

.hiw-subtitle {
  font-size: 1rem;
  color: var(--accent-gold-light);
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Steps grid */
.hiw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
  width: 100%;
}

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

@media (max-width: 540px) {
  .hiw-steps {
    grid-template-columns: 1fr;
  }
}

.hiw-step {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 166, 107, 0.18);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  transition: border-color 0.2s, background 0.2s;
}

.hiw-step:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(201, 166, 107, 0.35);
}

/* ===== UPDATED CTA BUTTON ===== */
.hiw-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-gold);
  color: var(--primary-dark);
  font-size: 1.1rem;           /* slightly bigger */
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 60px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  margin-bottom: 48px;
}

.hiw-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

/* SVG mask icon – slightly larger than text */
.hiw-cta-icon {
  display: inline-block;
  width: 1.7rem;
  height: 1.7rem;
  background-color: var(--primary-dark);
  mask-image: url('assets/diypawtag.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url('assets/diypawtag.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  flex-shrink: 0;
}

/* Remove old icon rule if any */
.hiw-cta-btn i {
  display: none;
}

.hiw-step-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(201, 166, 107, 0.15);
  border: 1px solid rgba(201, 166, 107, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.hiw-step-icon i {
  font-size: 1.3rem;
  color: var(--accent-gold);
}

.hiw-step-num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-gold);
  opacity: 0.6;
  margin-bottom: 8px;
  display: none;
}

.hiw-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  margin: 0 0 10px;
  line-height: 1.3;
}

.hiw-step-desc {
  font-size: 0.82rem;
  color: var(--accent-gold-light);
  opacity: 0.8;
  line-height: 1.65;
  margin: 0;
}

.hiw-step-desc strong {
  color: white;
  opacity: 1;
  font-weight: 600;
}

/* Callouts strip */
.hiw-callouts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid rgba(201, 166, 107, 0.15);
  padding-top: 40px;
  width: 100%;
}

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

@media (max-width: 480px) {
  .hiw-callouts {
    grid-template-columns: 1fr;
  }
}

.hiw-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hiw-callout > i {
  font-size: 1.3rem;
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.hiw-callout strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.hiw-callout span {
  font-size: 0.78rem;
  color: var(--accent-gold-light);
  opacity: 0.75;
  line-height: 1.55;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .hiw-section {
    padding: 52px 16px 60px;
  }
  .hiw-title {
    font-size: 1.6rem;
  }
  .hiw-header {
    margin-bottom: 36px;
  }
}

/* ===============================
   MOBILE STICKY ACTION BAR
   =============================== */

/* Bar is always in DOM; only visible on narrow screens */
.mob-bar {
  display: none;
}

.mob-bar.mob-bar-hidden {
  transform: translateY(110%);
  pointer-events: none;
}

@media (max-width: 640px) {
  .app-layout {
    padding-bottom: 90px;
    transition: padding-bottom 0.3s ease;
  }

  /* Once the mobile bar slides away near How It Works, collapse the space
     that was reserved for it so it doesn't leave a dead gap below the form. */
  body.hiw-mode .app-layout {
    padding-bottom: 24px;
  }

  #vn[data-page="index"] ~ #main-footer {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .desktop-btn-group {
    display: none !important;
  }

  .mob-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--primary-dark);
    border-top: 1px solid rgba(201, 166, 107, 0.35);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    align-items: center;
    gap: 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s ease;
  }

  .mob-bar-pre {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .mob-bar-progress {
    flex: 1;
  }

  .mob-bar-pill {
    display: inline-block;
    background: rgba(201, 166, 107, 0.15);
    border: 1px solid rgba(201, 166, 107, 0.35);
    color: var(--accent-gold-light);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    white-space: nowrap;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
  }

  .mob-bar-pill.complete {
    background: rgba(201, 166, 107, 0.28);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
  }

  .mob-bar-btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-gold);
    color: var(--primary-dark);
    border: none;
    border-radius: 40px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
  }

  .mob-bar-btn-generate:active {
    transform: scale(0.97);
  }

  .mob-bar-post {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
  }

  .mob-bar-dl {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(201, 166, 107, 0.25);
    border-radius: 12px;
    padding: 7px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--accent-gold-light);
    cursor: not-allowed;
    opacity: 0.5;
    transition: background 0.2s, opacity 0.2s;
    min-height: 52px;
  }

  .mob-bar-dl i {
    font-size: 1.1rem;
    color: var(--accent-gold-light);
  }

  .mob-bar-dl:not(:disabled) {
    cursor: pointer;
    opacity: 1;
    background: rgba(201, 166, 107, 0.12);
    border-color: rgba(201, 166, 107, 0.5);
    color: var(--accent-gold);
  }
  .mob-bar-dl[data-primary]:not(:disabled) {
    background: rgba(201, 166, 107, 0.22);
    border-color: var(--accent-gold);
  }

  .mob-bar-dl:not(:disabled) i {
    color: var(--accent-gold);
  }

  .mob-bar-dl:not(:disabled):active {
    transform: scale(0.96);
    background: rgba(201, 166, 107, 0.22);
  }

  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  /* Edit button – consolidated single definition */
  .mob-bar-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(201, 166, 107, 0.15);
    border: 1px solid rgba(201, 166, 107, 0.45);
    border-radius: 10px;
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    padding: 6px 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
  }
  .mob-bar-edit i {
    font-size: 1rem;
    color: var(--accent-gold);
  }
  .mob-bar-edit:active {
    background: rgba(201, 166, 107, 0.25);
  }

  /* Reset button – icon-only, danger tint to signal destructive action */
  .mob-bar-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(192, 57, 43, 0.18);
    border: 1px solid rgba(192, 57, 43, 0.5);
    border-radius: 10px;
    color: #f08070;
    font-size: 1rem;
    font-family: inherit;
    padding: 8px 9px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
  }
  .mob-bar-reset i {
    font-size: 1rem;
    color: #f08070;
  }
  .mob-bar-reset:active {
    background: rgba(192, 57, 43, 0.3);
  }
}

/* Extra small screen: hide label text on download buttons */
@media (max-width: 360px) {
  .mob-bar-post {
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  .mob-bar-dl span {
    display: none;
  }
  .mob-bar-dl {
    min-width: 44px;
    padding: 8px;
  }
}

/* ===============================
   UX IMPROVEMENTS
   =============================== */

/* Colour mode: radio cards – borderless */
.color-mode-group {
  flex-direction: column;
  gap: 8px;
}
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  background: white;
  flex-wrap: wrap;
  box-shadow: 0 0 0 1px var(--border-light);
}
.radio-card:hover {
  background: #fdfaf4;
  box-shadow: 0 0 0 1px var(--accent-gold);
}
.radio-card input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
}
.radio-card:has(input:checked),
.radio-card.selected {
  background: #fef9ee;
  box-shadow: 0 0 0 2px var(--accent-gold);
}
.radio-card-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: none;
  flex: 1;
  min-width: 80px;
}
.radio-card .radio-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  width: 100%;
  padding-left: 26px;
  margin-top: -2px;
}

/* Character counter */
.input-with-counter {
  position: relative;
}
.input-with-counter input {
  width: 100%;
  padding-right: 54px;
}
.input-with-counter .char-counter {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}
.input-with-counter .char-counter.warning,
.input-with-counter .char-counter.warn {
  color: #b45309;
  font-weight: 600;
}

/* Privacy disclosure */
.privacy-disclosure {
  font-size: 0.78rem;
  color: #92400E;
  margin-top: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FEF3C7;
  padding: 5px 9px;
  border-radius: 6px;
}

/* Appearance card: collapsible */
.appearance-card {
  padding: 0;
  overflow: hidden;
}
.appearance-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 18px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: left;
  border-left: 3px solid var(--accent-gold);
}
.appearance-toggle span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.appearance-toggle:hover { background: rgba(201,166,107,0.06); }
.appearance-chevron {
  font-size: 1rem;
  color: var(--accent-gold);
  transition: transform 0.2s;
}
.appearance-chevron.rotated { transform: rotate(180deg); }
.appearance-body {
  padding: 16px 18px 20px;
  border-top: 0.5px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.appearance-body[hidden] { display: none; }

.appearance-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 20px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-light);
}
.appearance-section-label:first-child {
  margin-top: 0;
}
.appearance-section-label i {
  font-size: 0.9rem;
  color: var(--accent-gold);
}

.appearance-body .swatch-wrapper {
  margin-bottom: 4px;
}
.appearance-bg-hint { display: block; margin-bottom: 4px; }
.appearance-body .swatch-row {
  gap: 10px;
  margin: 0 0 6px;
}

.appearance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.appearance-grid .full {
  grid-column: 1 / -1;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.color-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.color-field input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: white;
  padding: 2px;
}

.appearance-grid .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.appearance-grid .field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Preview: empty state */
.preview-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin: 8px 0 12px;
}
.preview-empty-inner {
  text-align: center;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  color: var(--text-muted);
}
.preview-empty-icon {
  font-size: 2.2rem;
  color: var(--accent-gold);
  opacity: 0.5;
  display: block;
  margin-bottom: 10px;
}
.preview-ghost-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.preview-ghost-hint strong {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Finder-view button */
.btn-preview-finder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,166,107,0.12);
  border: 1px solid var(--accent-gold);
  color: var(--primary-dark);
  padding: 8px 14px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  transition: background 0.2s;
  font-family: inherit;
  cursor: pointer;
}
.btn-preview-finder:hover { background: rgba(201,166,107,0.22); }

/* Downloads: label */
.dl-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
}

/* Generate button loading state */
.btn-primary.generating {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}

/* Caption flash */
@keyframes captionFlash {
  0%, 100% { background: white; }
  40% { background: #fef9e0; }
}
.caption-flash {
  animation: captionFlash 0.7s ease;
}

/* DOB future-date error */
#dobErr { display: none; }
.field.dob-invalid #dobErr { display: block; }
.field.dob-invalid input[type="date"] { border-color: var(--danger); }

/* Color mode radio hints */
.color-mode-group label {
  flex-direction: row; /* reset to default flex */
  align-items: flex-start;
}
.color-mode-group label input[type="radio"] {
  margin-top: 2px;
}
.radio-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding-left: 22px;
  line-height: 1.3;
}

/* Hint row (for char counters) */
.hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.char-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.2s;
}
.char-counter.warn {
  color: #CC8800;
  font-weight: 600;
}

/* Privacy note merged */
.privacy-note-merged {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}
.privacy-note-merged i {
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.9rem;
  color: var(--accent-gold);
}

/* Download section label */
.dl-section-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.3s;
}
.dl-section-label.unlocked {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  overflow: hidden;
}

/* Finder preview button */
.btn-finder-preview {
  background: transparent;
  border: 1px solid var(--primary-dark);
  color: var(--primary-dark);
  font-size: 0.8rem;
  padding: 8px 14px;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}
.btn-finder-preview:hover {
  background: rgba(22,70,63,0.06);
}

/* Mobile progress pill – visible from start */
.mob-bar-pill.visible {
  display: inline-block;
}
.mob-bar-pill {
  display: none;
}

/* ===============================
   ADDED: Mobile body background override & desktop padding reduction
   =============================== */

/* On mobile only (≤700px), turn body dark green when How It Works is visible */
@media (max-width: 700px) {
  body {
    transition: background 0.3s ease;
  }
  body.hiw-mode {
    background: var(--primary-dark);
  }
}

/* On tablets & desktops (≥768px), reduce the huge top padding */
@media (min-width: 768px) {
  .hiw-section {
    padding-top: 40px; /* was 72px – shrinks empty green space */
  }
  .hiw-header {
    margin-bottom: 32px; /* optional: tighter spacing */
  }
}