/* ============================================
   STICKERBOOK DESIGN SYSTEM
   Clean Canvas, Signature Accents
   ============================================ */

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
  /* === ACCENT COLORS === */
  /* Purple (Primary - 60% of accent usage) */
  --color-purple: #6D28D9;
  --color-purple-dark: #5B21B6;
  --color-purple-light: #8B5CF6;
  
  /* Turquoise (Secondary - 30% of accent usage) */
  --color-turquoise: #14B8A6;
  --color-turquoise-dark: #0D9488;
  --color-turquoise-light: #5EEAD4;
  
  /* Gold (Tertiary - 10%, special moments only) */
  --color-gold: #EAB308;
  --color-gold-dark: #CA8A04;
  --color-gold-light: #FACC15;
  
  /* === CANVAS (Light Mode Default) === */
  --color-canvas: #ffffff;
  --color-canvas-elevated: #ffffff;
  --color-canvas-subtle: #fafafa;
  --color-canvas-inset: #f4f4f5;
  
  /* === TEXT === */
  --color-text-primary: #18181b;
  --color-text-secondary: #3f3f46;
  --color-text-muted: #71717a;
  --color-text-subtle: #a1a1aa;
  --color-text-inverse: #ffffff;
  
  /* === BORDERS === */
  --color-border: #e4e4e7;
  --color-border-subtle: #f4f4f5;
  --color-border-strong: #d4d4d8;
  
  /* === SEMANTIC MAPPING === */
  --color-primary: var(--color-purple);
  --color-primary-dark: var(--color-purple-dark);
  --color-primary-light: var(--color-purple-light);
  
  --color-accent: var(--color-turquoise);
  --color-accent-dark: var(--color-turquoise-dark);
  --color-accent-light: var(--color-turquoise-light);
  
  --color-special: var(--color-gold);
  --color-special-dark: var(--color-gold-dark);
  --color-special-light: var(--color-gold-light);
  
  /* === INTERACTIVE STATES === */
  --color-selected: var(--color-turquoise);
  --color-selected-bg: rgba(20, 184, 166, 0.08);
  --color-selected-border: var(--color-turquoise);
  
  --color-hover-bg: rgba(0, 0, 0, 0.04);
  --color-active-bg: rgba(0, 0, 0, 0.06);
  
  --color-focus-ring: var(--color-turquoise-light);
  
  /* === STATUS === */
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: var(--color-gold);
  
  /* === SHADOWS === */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  
  --shadow-button: 0 4px 14px rgba(109, 40, 217, 0.25);
  --shadow-button-hover: 0 6px 20px rgba(109, 40, 217, 0.35);
  --shadow-button-active: 0 2px 8px rgba(109, 40, 217, 0.25);
  
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--color-border-subtle);
  
  /* === GRADIENTS === */
  --gradient-primary: linear-gradient(135deg, var(--color-purple) 0%, var(--color-purple-dark) 100%);
  --gradient-accent: linear-gradient(90deg, var(--color-purple) 0%, var(--color-turquoise) 100%);
  
  /* === TYPOGRAPHY === */
  --font-primary: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Poppins", system-ui, sans-serif;
  
  /* === SPACING === */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* === BORDER RADIUS === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
  :root {
    --color-canvas: #09090b;
    --color-canvas-elevated: #18181b;
    --color-canvas-subtle: #1f1f23;
    --color-canvas-inset: #27272a;
    
    --color-text-primary: #fafafa;
    --color-text-secondary: #d4d4d8;
    --color-text-muted: #a1a1aa;
    --color-text-subtle: #71717a;
    --color-text-inverse: #18181b;
    
    --color-border: #27272a;
    --color-border-subtle: #1f1f23;
    --color-border-strong: #3f3f46;
    
    --color-selected-bg: rgba(20, 184, 166, 0.12);
    
    --color-hover-bg: rgba(255, 255, 255, 0.04);
    --color-active-bg: rgba(255, 255, 255, 0.06);
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    
    --shadow-button: 0 4px 14px rgba(139, 92, 246, 0.25);
    --shadow-button-hover: 0 6px 20px rgba(139, 92, 246, 0.35);
    
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--color-border);
  }
}


/* ========== RESET ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
}


/* ========== BASE STYLES ========== */
body {
  font-family: var(--font-primary);
  font-size: 16px;
  background: var(--color-canvas);
  color: var(--color-text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Cross-platform text normalization - prevent browsers from auto-scaling */
html.plt-android,
body.plt-android,
html.plt-ios,
body.plt-ios {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}


/* ========== TYPOGRAPHY ========== */
.text-primary {
  color: var(--color-text-primary);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-subtle {
  color: var(--color-text-subtle);
}

.text-inverse {
  color: var(--color-text-inverse);
}

/* Display title (STICKERBOOK header) */
.title-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.title-display--large {
  font-size: 24px;
  letter-spacing: 0.12em;
}

.title-display--small {
  font-size: 18px;
  letter-spacing: 0.15em;
}

/* Screen titles */
.screen-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 4px 0 6px;
  color: var(--color-text-primary);
}

.screen-subtitle {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}

/* Body text */
.text-body {
  font-size: 14px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Tagline with gradient */
.text-tagline {
  font-weight: 700;
  text-transform: uppercase;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.03em;
}


/* ========== TITLE STICKER (Splash) ========== */
.title-sticker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 40px;
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.title-sticker__text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.title-sticker__bar {
  width: 100px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}


/* ========== ACCENT BAR ========== */
.accent-bar {
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}

.accent-bar--sm {
  width: 60px;
}

.accent-bar--md {
  width: 80px;
}

.accent-bar--lg {
  width: 100px;
}


/* ========== BUTTONS ========== */
.btn {
  width: 100%;
  border-radius: var(--radius-pill);
  border: none;
  padding: 14px 28px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-button-hover);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-button-active);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background: var(--color-border-strong);
  color: var(--color-text-subtle);
  transform: none;
}

.btn-secondary {
  background: var(--color-canvas);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--color-canvas-subtle);
  border-color: var(--color-border-strong);
}

.btn-secondary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-outline {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-outline:hover {
  background: var(--color-hover-bg);
  border-color: var(--color-border-strong);
}

.btn-outline:active {
  transform: translateY(1px);
  background: var(--color-active-bg);
}

/* Skip/Cancel button */
.btn-skip {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-skip:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}



/* ========== LOGO ========== */
.logo-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.logo-accent {
  width: 60px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}


/* ========== CARDS ========== */
.card {
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-lg);
}


/* ========== APP SHELL ========== */
.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.phone-frame {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.phone-notch {
  display: none;
}

.phone-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.shell-inner {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
}


/* ========== HEADER ROW ========== */
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.top-row--centered {
  justify-content: center;
}

.back-link {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-primary);
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--color-text-secondary);
}

.back-link .icon {
  font-size: 12px;
  transform: translateY(0.5px);
}


/* ========== FORM FIELDS ========== */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
}

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

.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.field-input {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  font-size: 13px;
  background: var(--color-canvas);
  color: var(--color-text-primary);
  outline: none;
  font-family: var(--font-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.field-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.field-helper {
  font-size: 10px;
  color: var(--color-text-subtle);
}

.field-error {
  font-size: 10px;
  color: var(--color-error);
  margin-top: 2px;
  min-height: 12px;
}

.field-error.hidden {
  visibility: hidden;
}

/* Field row variants */
.field-row-2 {
  display: flex;
  gap: 8px;
}

.field-row-2 .field-input {
  flex: 1;
  min-width: 0;
}

.dob-row {
  display: flex;
  gap: 8px;
}

.dob-row .field-input {
  text-align: center;
  flex: 1;
  min-width: 0;
}

/* Location row (City / State / Zip) */
.location-row {
  display: flex;
  gap: 8px;
}

.location-row .field-input {
  min-width: 0;
}

.location-row .field-input--city {
  flex: 2;
}

.location-row .field-input--state {
  flex: 1;
  text-align: center;
  text-transform: uppercase;
}

.location-row .field-input--zip {
  flex: 1;
  text-align: center;
}


/* ========== PASSWORD RULES ========== */
.password-rules {
  margin-top: 4px;
  font-size: 10px;
  color: var(--color-text-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.password-rule {
  transition: color 0.2s ease;
}

.password-rule.met {
  color: var(--color-success);
}


/* ========== TERMS ROW ========== */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.terms-row input[type="checkbox"] {
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.terms-row a {
  color: var(--color-accent);
  text-decoration: none;
}

.terms-row a:hover {
  text-decoration: underline;
}


/* ========== CTA ROW ========== */
.cta-row {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* ========== STICKER STYLES ========== */
.sticker {
  position: absolute;
  pointer-events: none;
}

.sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* ========== STICKER GRID & TILES ========== */
.sticker-section {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sticker-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin: 4px 0 6px;
  flex-shrink: 0;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 6px;
}

.sticker-tile {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--color-canvas-subtle);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
  min-width: 86px;
}

.sticker-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-border-strong);
}

.sticker-tile.selected {
  background: var(--color-selected-bg);
  border-color: var(--color-selected-border);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.sticker-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
}

.sticker-image {
  max-width: 80px;
  max-height: 80px;
  display: block;
  object-fit: contain;
}


/* ========== CATEGORY ROWS (Netflix-style) ========== */
.overview-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.row-section {
  margin-bottom: 12px;
}

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

.row-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.row-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.row-strip::-webkit-scrollbar {
  height: 4px;
}

.row-strip::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}

.row-strip::-webkit-scrollbar-track {
  background: transparent;
}

.see-more-tile {
  min-width: 80px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border-strong);
  background: var(--color-canvas-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.see-more-tile:hover {
  border-color: var(--color-primary);
  background: var(--color-hover-bg);
}

.see-more-tile span {
  font-size: 16px;
  margin-bottom: 4px;
}


/* ========== CATEGORY DETAIL VIEW ========== */
.category-detail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.category-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.category-detail-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.category-detail-subtitle {
  font-size: 11px;
  color: var(--color-text-subtle);
}

.category-detail-grid-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  margin-top: 4px;
}

.back-link-small {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-primary);
  transition: color 0.15s ease;
}

.back-link-small:hover {
  color: var(--color-text-secondary);
}

.back-link-small .icon {
  font-size: 12px;
  transform: translateY(0.5px);
}


/* ========== SEARCH ========== */
.search-row {
  margin: 8px 0 6px;
  flex-shrink: 0;
}

.search-wrapper {
  position: relative;
  max-width: 220px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  padding: 8px 28px;
  font-size: 12px;
  background: var(--color-canvas);
  color: var(--color-text-primary);
  outline: none;
  font-family: var(--font-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--color-text-subtle);
}

.search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--color-text-subtle);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: color 0.15s ease;
}

.search-clear:hover {
  color: var(--color-text-secondary);
}


/* ========== SELECTION FOOTER ========== */
.selection-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.selection-text {
  font-size: 11px;
  color: var(--color-text-muted);
  flex: 1;
}

.selection-text span {
  font-weight: 600;
  color: var(--color-text-primary);
}

.inline-error {
  font-size: 10px;
  color: var(--color-error);
  margin-top: 4px;
  min-height: 12px;
}

.empty-msg {
  font-size: 11px;
  color: var(--color-text-subtle);
  margin-top: 6px;
}


/* ========== SCROLLBAR STYLES ========== */
.overview-rows::-webkit-scrollbar,
.category-detail-grid-wrapper::-webkit-scrollbar {
  width: 4px;
}

.overview-rows::-webkit-scrollbar-thumb,
.category-detail-grid-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}

.overview-rows::-webkit-scrollbar-track,
.category-detail-grid-wrapper::-webkit-scrollbar-track {
  background: transparent;
}


/* ========== UTILITY CLASSES ========== */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.text-center {
  text-align: center;
}

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.hidden {
  display: none !important;
}


/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .phone-frame {
    padding: 20px 16px;
  }

  .screen-title {
    font-size: 16px;
  }

  .screen-subtitle {
    font-size: 11px;
  }

  .field-input {
    font-size: 12px;
    padding: 9px 14px;
  }

  .btn {
    font-size: 11px;
    padding: 12px 24px;
  }

  .field-row-2 {
    flex-direction: column;
  }
  
  .location-row {
    flex-wrap: wrap;
  }
  
  .location-row .field-input--city {
    flex: 1 1 100%;
  }
  
  .location-row .field-input--state,
  .location-row .field-input--zip {
    flex: 1;
  }
}


/* ========== CONTAINED SCROLL LAYOUT ========== */
body.layout-contained {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

body.layout-contained .app-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.layout-contained .phone-frame {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-top: 20px;
  padding-bottom: 20px;
}

body.layout-contained .phone-inner {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

body.layout-contained .shell-inner {
  height: 100%;
  min-height: 0;
}

body.layout-contained .sticker-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.layout-contained .sticker-container {
  flex: 1;
  min-height: 0;
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
}

body.layout-contained .category-detail {
  flex: 1;
  min-height: 0;
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
}

body.layout-contained .top-row {
  flex-shrink: 0;
  margin-bottom: 8px;
}

body.layout-contained .screen-title {
  flex-shrink: 0;
  margin-bottom: 12px;
}

body.layout-contained .search-row {
  flex-shrink: 0;
  margin-top: 12px;
}

body.layout-contained .search-wrapper {
  max-width: 275px;
}

body.layout-contained .search-input {
  padding: 10px 32px;
  font-size: 13px;
}

body.layout-contained .search-icon {
  left: 12px;
  font-size: 14px;
}

body.layout-contained .search-clear {
  right: 12px;
  font-size: 13px;
}

body.layout-contained .selection-footer {
  flex-shrink: 0;
  margin-top: 12px;
  border-top: none;
  padding-top: 0;
}

body.layout-contained .row-header {
  justify-content: center;
}

body.layout-contained .row-title {
  text-align: center;
}

body.layout-contained .row-section {
  margin-bottom: 16px;
}

/* See-more button - accent style */
body.layout-contained .see-more-tile {
  min-width: 80px;
  min-height: 72px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-inverse);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-button);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

body.layout-contained .see-more-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-button-hover);
}

body.layout-contained .see-more-tile:active {
  transform: translateY(0);
  box-shadow: var(--shadow-button-active);
}

body.layout-contained .overview-rows {
  overflow: visible;
}


/* ========== BACKGROUND PICKER ========== */
.bg-picker-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Pattern type tabs */
.bg-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
  width: 296px;
  margin: 0 auto 10px;
}

.bg-tab {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-canvas);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-primary);
}

.bg-tab:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}

.bg-tab.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button);
}

/* Sub-filter buttons - FIXED: removed flex:1, added flex:none */
.bg-subfilter {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto 10px;
}

.bg-subfilter-btn {
  flex: none;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-primary);
}

.bg-subfilter-btn:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-muted);
}

.bg-subfilter-btn.active {
  background: var(--color-text-primary);
  border-color: var(--color-text-primary);
  color: var(--color-text-inverse);
}

/* Scrollable rows container */
.bg-rows-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.bg-rows-container::-webkit-scrollbar {
  width: 4px;
}

.bg-rows-container::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}

.bg-rows-container::-webkit-scrollbar-track {
  background: transparent;
}

/* Row sections */
.bg-row-section {
  margin-bottom: 5px;
}

/* Horizontal strip */
.bg-row-strip {
  display: flex;
  gap: 5px;
  justify-content: center;
  width: 296px;
  margin: 0 auto;
  padding: 2px 0;
}

/* Background tiles */
.bg-tile-new {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.bg-tile-new:hover {
  transform: scale(1.1);
  z-index: 2;
}

.bg-tile-new:active {
  transform: scale(1.05);
}

.bg-tile-new-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow 0.15s ease;
}

.bg-tile-new-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color 0.15s ease;
}

.bg-tile-new.selected .bg-tile-new-inner {
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.25);
}

.bg-tile-new.selected .bg-tile-new-inner::after {
  border-color: var(--color-selected);
}

/* Preview area with swatches */
.bg-preview-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  flex-shrink: 0;
  width: 296px;
  margin: 0 auto;
}

.bg-preview-tile {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.bg-swatch:hover {
  border-color: var(--color-border-strong);
}

.bg-swatch.active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.bg-swatch-color {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.bg-swatch-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

body.layout-contained .bg-picker-section {
  flex: 1;
  min-height: 0;
}

body.layout-contained .bg-rows-container {
  flex: 1;
  min-height: 0;
}

/* ========== STICKER DRAWER TABS (My Stickers / Create / Archived Pages) ========== */
.drawer-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.drawer-tab {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-canvas);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-primary);
  white-space: nowrap;
}

.drawer-tab:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}

.drawer-tab.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button);
}


/* ============================================
   SOCIAL FEATURES
   Matching, Connections, Chat
   ============================================ */

/* ========== SHARED STICKER SHIMMER ========== */
@keyframes shimmer-gradient {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes shimmer-glow {
  0%, 100% {
    filter: drop-shadow(0 0 0px transparent);
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(109, 40, 217, 0.5));
  }
}

@keyframes gold-frame-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px var(--color-gold), 0 0 8px rgba(234, 179, 8, 0.4);
  }
  50% {
    box-shadow: 0 0 0 3px var(--color-gold), 0 0 16px rgba(234, 179, 8, 0.6);
  }
}

.sticker-shared {
  position: relative;
  animation: shimmer-glow 2s ease-in-out infinite;
}

.sticker-shared::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-purple-light) 25%,
    var(--color-turquoise-light) 50%,
    var(--color-purple-light) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer-gradient 2.5s linear infinite;
  opacity: 0.6;
  z-index: -1;
}

.sticker-shared::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-md);
  animation: gold-frame-pulse 2s ease-in-out infinite;
  pointer-events: none;
}


/* ========== AVATAR STYLES ========== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar--xs {
  width: 32px;
  height: 32px;
}

.avatar--sm {
  width: 40px;
  height: 40px;
}

.avatar--md {
  width: 56px;
  height: 56px;
}

.avatar--lg {
  width: 80px;
  height: 80px;
}

.avatar--xl {
  width: 120px;
  height: 120px;
}

.avatar-wrapper {
  position: relative;
  cursor: pointer;
}

.avatar-border {
  border: 2px solid var(--color-border);
  transition: border-color 0.15s ease;
}

.avatar-border:hover {
  border-color: var(--color-turquoise);
}


/* ========== AVATAR EXPANDED POPUP ========== */
.avatar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-md);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  min-width: 160px;
}

.avatar-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.avatar-popup__photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--spacing-sm);
  display: block;
}

.avatar-popup__name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.avatar-popup__details {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}


/* ========== SOCIAL PAGE DOTS ========== */
.social-page-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: var(--spacing-sm) 0;
}

.social-page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-strong);
  transition: background 0.2s ease, transform 0.2s ease;
}

.social-page-dot.active {
  background: var(--color-purple);
  transform: scale(1.2);
}

.social-page-dot.viewed {
  background: var(--color-turquoise);
}


/* ========== DISCOVERY CARD ========== */
.discovery-card {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  touch-action: pan-y;
}

.discovery-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-md);
  padding-top: max(var(--spacing-md), env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}

.discovery-header > * {
  pointer-events: auto;
}

.discovery-stickerbook {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discovery-page {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Tap zones for page navigation */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  z-index: 5;
  cursor: pointer;
}

.tap-zone--left {
  left: 0;
}

.tap-zone--right {
  right: 0;
}


/* ========== SWIPE INDICATORS ========== */
.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.swipe-indicator--pass {
  left: var(--spacing-lg);
  background: rgba(220, 38, 38, 0.9);
  color: white;
  border: 3px solid #dc2626;
}

.swipe-indicator--like {
  right: var(--spacing-lg);
  background: rgba(22, 163, 74, 0.9);
  color: white;
  border: 3px solid #16a34a;
}

.swipe-indicator.visible {
  opacity: 1;
}


/* ========== SOCIAL EMPTY STATE ========== */
.social-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  text-align: center;
  flex: 1;
}

.social-empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.social-empty-state__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.social-empty-state__text {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 260px;
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}


/* ========== MATCH MODAL ========== */
.match-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.match-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.match-modal {
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  max-width: 320px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.match-modal-overlay.visible .match-modal {
  transform: scale(1);
}

.match-modal__avatars {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.match-modal__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.match-modal__subtitle {
  font-size: 14px;
  color: var(--color-turquoise);
  margin-bottom: var(--spacing-lg);
  font-weight: 500;
}

.match-modal__actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}


/* ========== CONFETTI ANIMATION ========== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 999;
}

.confetti-sticker {
  position: absolute;
  top: -100px;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 150px)) rotate(var(--rotation, 360deg));
    opacity: 0;
  }
}


/* ========== CONNECTIONS LIST ========== */
.connections-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.connection-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.connection-row:hover {
  background: var(--color-canvas-subtle);
}

.connection-row:active {
  background: var(--color-active-bg);
}

.connection-info {
  flex: 1;
  min-width: 0;
}

.connection-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.connection-preview {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-preview--nudge {
  color: var(--color-turquoise);
  font-style: italic;
}

.connection-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.connection-time {
  font-size: 11px;
  color: var(--color-text-subtle);
}

.connection-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-purple);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ========== CHAT INTERFACE ========== */
.chat-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  padding-top: max(var(--spacing-md), env(safe-area-inset-top));
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.chat-header__back {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.chat-header__back:hover {
  color: var(--color-text-primary);
}

.chat-header__info {
  flex: 1;
  min-width: 0;
}

.chat-header__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text-primary);
}

.chat-header__status {
  font-size: 12px;
  color: var(--color-text-muted);
}

.chat-header__menu {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.chat-header__menu:hover {
  color: var(--color-text-primary);
}


/* ========== CHAT MESSAGES ========== */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl);
}

.chat-empty__reason {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 260px;
}

.message {
  max-width: 75%;
  display: flex;
  flex-direction: column;
}

.message--sent {
  align-self: flex-end;
}

.message--received {
  align-self: flex-start;
}

.message__bubble {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
}

.message--sent .message__bubble {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.message--received .message__bubble {
  background: var(--color-canvas-inset);
  color: var(--color-text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.message__time {
  font-size: 10px;
  color: var(--color-text-subtle);
  margin-top: 4px;
}

.message--sent .message__time {
  text-align: right;
}

/* Sticker message */
.message__sticker {
  max-width: 120px;
  max-height: 120px;
}

/* Voice note */
.message__voice {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  min-width: 140px;
}

.message--sent .message__voice {
  background: var(--gradient-primary);
  color: white;
}

.message--received .message__voice {
  background: var(--color-canvas-inset);
  color: var(--color-text-primary);
}

.voice-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message--received .voice-play-btn {
  background: var(--color-border);
}

.voice-waveform {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voice-bar {
  width: 3px;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.6;
}

.voice-duration {
  font-size: 11px;
  opacity: 0.8;
}


/* ========== CHAT INPUT ========== */
.chat-input-area {
  padding: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
}

.chat-attachment-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.chat-attachment-btn:hover {
  border-color: var(--color-turquoise);
  color: var(--color-turquoise);
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  color: var(--color-text-primary);
  font-size: 14px;
  font-family: var(--font-primary);
  outline: none;
  resize: none;
  max-height: 120px;
  transition: border-color 0.15s ease;
}

.chat-input:focus {
  border-color: var(--color-turquoise);
}

.chat-input::placeholder {
  color: var(--color-text-subtle);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-button);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-button-hover);
}

.chat-send-btn:active {
  transform: translateY(1px);
}

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


/* ========== ATTACHMENT MENU ========== */
.attachment-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
}

.attachment-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.attachment-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.attachment-option:hover {
  background: var(--color-hover-bg);
}

.attachment-option__icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.attachment-option__label {
  font-size: 13px;
  color: var(--color-text-primary);
}


/* ========== STICKER PICKER (In Chat) ========== */
.sticker-picker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-canvas-elevated);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 100;
}

.sticker-picker.visible {
  transform: translateY(0);
}

.sticker-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sticker-picker__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.sticker-picker__close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.sticker-picker__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  overflow-y: auto;
  flex: 1;
}

.sticker-picker__item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--color-canvas-subtle);
  padding: var(--spacing-xs);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-picker__item:hover {
  transform: scale(1.05);
  background: var(--color-hover-bg);
}

.sticker-picker__item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}


/* ========== VOICE RECORDER ========== */
.voice-recorder {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.voice-recorder.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.voice-recorder__circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--color-error);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px rgba(220, 38, 38, 0);
  }
}

.voice-recorder__icon {
  font-size: 48px;
  color: white;
}

.voice-recorder__time {
  margin-top: var(--spacing-lg);
  font-size: 24px;
  font-weight: 600;
  color: white;
  font-variant-numeric: tabular-nums;
}

.voice-recorder__hint {
  margin-top: var(--spacing-md);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}


/* ========== OPTIONS MENU (Unmatch/Block/Report) ========== */
.options-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--color-canvas-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: var(--spacing-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 100;
}

.options-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.options-menu__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-primary);
  transition: background 0.15s ease;
}

.options-menu__item:hover {
  background: var(--color-hover-bg);
}

.options-menu__item--danger {
  color: var(--color-error);
}

.options-menu__item--danger:hover {
  background: rgba(220, 38, 38, 0.1);
}


/* ========== DATING PREFERENCES MODAL ========== */
.prefs-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  text-align: left;
}

.prefs-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.prefs-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.prefs-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.prefs-option {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prefs-option:hover {
  border-color: var(--color-border-strong);
}

.prefs-option.selected {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

.prefs-row {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.prefs-select {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  color: var(--color-text-primary);
  font-size: 13px;
  font-family: var(--font-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.prefs-to {
  font-size: 13px;
  color: var(--color-text-muted);
}


/* ========== OPEN TO MORE BUTTON ========== */
.open-to-more-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.open-to-more-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.open-to-more-btn.tapped {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-text-inverse);
}

.open-to-more-btn__icon {
  font-size: 14px;
}


/* ========== PHOTO CHECKPOINT MODAL ========== */
.checkpoint-modal {
  text-align: center;
}

.checkpoint-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--spacing-md);
  border: 4px solid var(--color-border);
}

.checkpoint-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.checkpoint-details {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.checkpoint-prompt {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}


/* ========== ROMANTIC REVEAL BADGE ========== */
.romantic-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  color: var(--color-text-inverse);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* ========== BOTTOM NAV (Persistent) ========== */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-canvas);
  flex-shrink: 0;
}

/* Scoped to bottom-nav to avoid conflict with slide-out menu .nav-item */
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease;
  text-decoration: none;
}

.bottom-nav .nav-item:hover {
  color: var(--color-text-secondary);
}

.bottom-nav .nav-item.active {
  color: var(--color-purple);
}

.bottom-nav .nav-item__icon {
  font-size: 20px;
}

.bottom-nav .nav-item__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-purple);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav .nav-item__badge.hidden {
  display: none;
}

.bottom-nav .nav-item__icon-wrapper {
  position: relative;
}


/* ========== SETTINGS GEAR ========== */
.settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s ease;
}

.settings-btn:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}


/* ========== DAILY LIMIT MESSAGE ========== */
.limit-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  text-align: center;
  flex: 1;
}

.limit-message__emoji {
  font-size: 64px;
  margin-bottom: var(--spacing-lg);
}

.limit-message__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.limit-message__text {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 280px;
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

.limit-message__countdown {
  font-size: 13px;
  color: var(--color-turquoise);
  font-weight: 600;
}


/* ========== UNIFIED APP HEADER ========== */

.site-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px 16px 8px;
  padding-top: max(12px, env(safe-area-inset-top));
  flex-shrink: 0;
}

.site-header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-header-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.site-header-accent {
  width: 70px;
  height: 3px;
  margin-top: 6px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}

.site-header-spacer {
  width: 40px;
  flex-shrink: 0;
}

/* Header logo (SVG) */
.header-logo {
  display: block;
  width: 220px;
  height: auto;
}

/* ========== NAV OVERLAY & PANEL ========== */

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: #18181b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 901;
  display: flex;
  flex-direction: column;
}

.nav-panel.visible {
  transform: translateX(0);
}

.nav-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}

.nav-brand-logo {
  display: block;
  width: 160px;
  height: auto;
}

.nav-items {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(109, 40, 217, 0.15);
}

.nav-item:active {
  background: rgba(109, 40, 217, 0.25);
}

.nav-item--danger {
  color: #EF4444;
}

/* ========== SHARED MENU BUTTON ========== */

.menu-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.menu-btn:hover {
  background: rgba(109, 40, 217, 0.08);
}

/* ========== COIN ICON ========== */

.coin-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url('../assets/stickerbook_coin.png') center/contain no-repeat;
  vertical-align: middle;
}

/* ========== LEGACY APP HEADER (for index.html) ========== */

.app-header__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.app-header__accent {
  width: 70px;
  height: 3px;
  margin-top: 6px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}

/* ========== APP HEADER (Centered Column - for index.html) ========== */

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 10px;
  padding-top: max(12px, env(safe-area-inset-top));
  flex-shrink: 0;
}