/* =========
   RESET / BASE
   ========= */
*,
*::before,
*::after { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif; color: #111; background: #f7f7f8; }

:root{
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --surface: #ffffff;
  --muted: #f2f2f4;
  --border: #e5e7eb;
  --text: #111114;
  --subtle: #6b6f76;
  --brand: #2563eb;      /* blue-600 */
  --brand-ink: #fff;
  --warn-bg: #fff3cd;
  --warn-ink: #7a5b00;
  --sheet-shadow: 0 10px 30px rgba(0,0,0,.14);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --z-map: 0;
  --z-fab: 5;
  --z-sheet: 10;
  --sheet-padding: 16px;  /* Consistent horizontal padding for all sheet content */
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #1e1e1e;        /* Warm charcoal - comfortable dark gray */
    --bg-rgb: 30, 30, 30;
    --surface: #2d2d2d;   /* Slightly elevated surface */
    --muted: #2d2d2d;     /* Slightly elevated surface */
    --border: #3a3a3a;
    --text: #eef1f5;
    --subtle: #9aa3ad;
    --brand: #4f8cff;
    --brand-ink: #1e1e1e;
    --warn-bg: #3a2e00;
    --warn-ink: #ffd666;
    --sheet-shadow: 0 12px 30px rgba(0,0,0,.45);
  }
  body { background: #1e1e1e; }

  /* Dark mode card shadows */
  .art-card{
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .art-card.has-location:hover{
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }
}

/* =========
   MAP LAYER
   ========= */
#map{
  position: fixed;
  inset: 0;
  z-index: var(--z-map);
}

/* =========
   FLOATING ACTION BUTTONS
   ========= */
.fab-stack{
  position: fixed;
  right: 16px;
  top: 16px;
  display: grid;
  gap: 10px;
  z-index: var(--z-fab);
}
.fab{
  appearance: none;
  border: 0;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.fab svg{
  display: block;
}
.fab:hover{
  background: var(--muted);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.fab:active{
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* =========
   BOTTOM SHEET
   ========= */
.sheet{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: var(--z-sheet);
  background: var(--bg);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: var(--sheet-shadow);
  display: grid;
  grid-template-rows: auto auto 1fr; /* header, sticky bar, scroll body */
  max-height: 92vh; /* cap when fully expanded */
  height: var(--sheet-height, 12vh); /* Use JS-controlled height */
  transition: height .15s ease-out;
  box-sizing: border-box;
  overflow: hidden;
}

/* Keep these for fallback/non-JS scenarios */
.sheet[data-state="collapsed"]{
  height: 15vh;
}
.sheet[data-state="mid"]{
  height: 52.5vh;
}
.sheet[data-state="expanded"]{
  height: 90vh;
}

/* Header */
.sheet-header{
  position: relative;
  padding: 10px var(--sheet-padding) 16px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  text-align: left;
}
.sheet-header:active{
  cursor: grabbing;
}
.sheet-handle{
  width: 80px;
  height: 24px;
  margin: 8px auto 8px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-handle svg{
  width: 100%;
  height: 100%;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg); /* Points down when expanded */
}

/* Point up when collapsed */
.sheet[data-state="collapsed"] .sheet-handle svg{
  transform: rotate(180deg);
}
.sheet-title{
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  pointer-events: none;
  transition: padding-left 0.2s ease, text-align 0.2s ease;
}
.sheet-subtitle{
  font-size: 14px;
  color: var(--subtle);
  margin: 4px 0 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.back-btn{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.8;
  transition: all 0.2s ease;
  pointer-events: auto;
  border-radius: 8px;
}
.back-btn:hover{
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}
.back-btn i{
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}
.user-icon-btn{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--muted);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--subtle);
  transition: all 0.2s;
  pointer-events: auto;
}
.user-icon-btn:hover{
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.user-icon-btn.logged-in{
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.user-icon-btn.logged-in:hover{
  opacity: 0.9;
}
.user-icon-btn svg{
  display: block;
}

/* Sticky (search + chips) stays attached to the sheet, not viewport */
.sheet-sticky{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 6px var(--sheet-padding) 10px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

/* Search */
.searchbar{
  display: grid;
  margin-bottom: 8px;
}
.searchbar input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

/* Chips */
.chips-scroll{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.chip{
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active{
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

/* Scroll region inside sheet */
.sheet-scroll{
  min-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px var(--sheet-padding) 16px;
  padding-left: max(var(--sheet-padding), env(safe-area-inset-left));
  padding-right: max(var(--sheet-padding), env(safe-area-inset-right));
  width: 100%;
  box-sizing: border-box;
}

/* Advertisement Container */
.ad-container{
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 16px;
  position: relative;
  text-align: center;
}

/* Show mobile ad by default, hide desktop */
.ad-mobile{
  display: block !important;
}

.ad-desktop{
  display: none !important;
}

.ad-label{
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--subtle);
  margin-bottom: 12px;
  text-align: center;
}

/* Desktop version - elevated container */
@media (min-width: 768px) {
  .ad-container{
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
  }

  /* Hide mobile ad, show desktop ad */
  .ad-mobile{
    display: none !important;
  }

  .ad-desktop{
    display: inline-block !important;
  }

  .ad-label{
    font-size: 10px;
    margin-bottom: 8px;
  }
}

/* Learn More Section */
.learn-more-section{
  padding: 32px 0 16px 0;
}
.learn-more-section .section-title{
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--subtle);
  margin-bottom: 12px;
}
.info-links{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.info-link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.info-link:hover{
  background: var(--brand);
  color: var(--brand-ink);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}
.info-link i{
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark){
  .info-link{
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  .info-link:hover{
    box-shadow: 0 4px 8px rgba(79, 140, 255, 0.3);
  }
}

/* Support Section */
.support-section{
  padding: 32px 0 16px 0;
  text-align: left;
}
.coffee-button{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.coffee-button:hover{
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.coffee-button:active{
  transform: translateY(0);
}
.coffee-button i{
  width: 18px;
  height: 18px;
}
/* Footer */
.footer{
  padding: 16px 0 24px 0;
  text-align: left;
}
.footer-links{
  font-size: 12px;
  color: var(--subtle);
  opacity: 0.7;
  margin-bottom: 8px;
}
.footer-link{
  color: var(--subtle);
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-link:hover{
  opacity: 1;
  text-decoration: underline;
}
.footer-separator{
  margin: 0 8px;
  color: var(--subtle);
  opacity: 0.5;
}
.footer-meta{
  font-size: 12px;
  color: var(--subtle);
  opacity: 0.6;
}

/* =========
   TILES / LIST / SHELVES
   ========= */
.tile{
  width: 100%;
  border: 0;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: var(--radius-md);
  padding: 0;
  cursor: pointer;
  margin-bottom: 14px;
}
.tile .tile-body{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}
.tile-title{ font-weight: 700; }
.tile-subtitle{ font-size: 13px; opacity: .85; }
.tile-icon{ font-size: 22px; }

/* Shelf wrapper */
.shelf{
  margin: 20px 0 6px;
}
.shelf-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 12px;
}
.shelf-head h2{
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.see-all{
  border: 0; background: transparent; color: var(--brand); cursor: pointer;
}

/* Horizontal rows */
.shelf-row{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Favorites cards - square with image */
.fav-card{
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}
.fav-image{
  width: 160px;
  height: 160px;
  border-radius: 12px;
  background: var(--muted);
  overflow: hidden;
  position: relative;
}
.fav-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fav-title{
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}
.fav-artist{
  font-size: 13px;
  color: var(--subtle);
  line-height: 1.3;
  margin: 0;
}

/* Collections cards - landscape with photo background and text overlay */
.collection-card{
  width: 280px;
  height: 160px;
  border-radius: 16px;
  background: var(--muted);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
}
.collection-card img{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 3s ease-in-out;
}
.collection-card img.active{
  opacity: 1;
}

/* Ken Burns variations - animations run continuously on ALL images */
/* This prevents snapping when fading between images */
.collection-card img.kb-zoom-pulse{
  -webkit-animation: kbZoomPulse 12s ease-in-out infinite;
  animation: kbZoomPulse 12s ease-in-out infinite;
}
.collection-card img.kb-pan-left{
  -webkit-animation: kbPanLeft 12s linear infinite;
  animation: kbPanLeft 12s linear infinite;
}
.collection-card img.kb-pan-right{
  -webkit-animation: kbPanRight 12s linear infinite;
  animation: kbPanRight 12s linear infinite;
}
.collection-card img.kb-pan-up{
  -webkit-animation: kbPanUp 12s linear infinite;
  animation: kbPanUp 12s linear infinite;
}
.collection-card img.kb-pan-down{
  -webkit-animation: kbPanDown 12s linear infinite;
  animation: kbPanDown 12s linear infinite;
}
.collection-card img.kb-drift-1{
  -webkit-animation: kbDrift1 12s ease-in-out infinite;
  animation: kbDrift1 12s ease-in-out infinite;
}
.collection-card img.kb-drift-2{
  -webkit-animation: kbDrift2 12s ease-in-out infinite;
  animation: kbDrift2 12s ease-in-out infinite;
}

/* Gentle zoom pulse - breathes in and out */
@-webkit-keyframes kbZoomPulse {
  0%, 100% { -webkit-transform: scale(1.02); transform: scale(1.02); }
  50% { -webkit-transform: scale(1.08); transform: scale(1.08); }
}
@keyframes kbZoomPulse {
  0%, 100% { -webkit-transform: scale(1.02); transform: scale(1.02); }
  50% { -webkit-transform: scale(1.08); transform: scale(1.08); }
}

/* Continuous pans - seamless loops by returning to start */
@-webkit-keyframes kbPanLeft {
  0%, 100% { -webkit-transform: scale(1.08) translateX(2%); transform: scale(1.08) translateX(2%); }
  50% { -webkit-transform: scale(1.08) translateX(-2%); transform: scale(1.08) translateX(-2%); }
}
@keyframes kbPanLeft {
  0%, 100% { -webkit-transform: scale(1.08) translateX(2%); transform: scale(1.08) translateX(2%); }
  50% { -webkit-transform: scale(1.08) translateX(-2%); transform: scale(1.08) translateX(-2%); }
}

@-webkit-keyframes kbPanRight {
  0%, 100% { -webkit-transform: scale(1.08) translateX(-2%); transform: scale(1.08) translateX(-2%); }
  50% { -webkit-transform: scale(1.08) translateX(2%); transform: scale(1.08) translateX(2%); }
}
@keyframes kbPanRight {
  0%, 100% { -webkit-transform: scale(1.08) translateX(-2%); transform: scale(1.08) translateX(-2%); }
  50% { -webkit-transform: scale(1.08) translateX(2%); transform: scale(1.08) translateX(2%); }
}

@-webkit-keyframes kbPanUp {
  0%, 100% { -webkit-transform: scale(1.08) translateY(2%); transform: scale(1.08) translateY(2%); }
  50% { -webkit-transform: scale(1.08) translateY(-2%); transform: scale(1.08) translateY(-2%); }
}
@keyframes kbPanUp {
  0%, 100% { -webkit-transform: scale(1.08) translateY(2%); transform: scale(1.08) translateY(2%); }
  50% { -webkit-transform: scale(1.08) translateY(-2%); transform: scale(1.08) translateY(-2%); }
}

@-webkit-keyframes kbPanDown {
  0%, 100% { -webkit-transform: scale(1.08) translateY(-2%); transform: scale(1.08) translateY(-2%); }
  50% { -webkit-transform: scale(1.08) translateY(2%); transform: scale(1.08) translateY(2%); }
}
@keyframes kbPanDown {
  0%, 100% { -webkit-transform: scale(1.08) translateY(-2%); transform: scale(1.08) translateY(-2%); }
  50% { -webkit-transform: scale(1.08) translateY(2%); transform: scale(1.08) translateY(2%); }
}

/* Smooth drifting motions */
@-webkit-keyframes kbDrift1 {
  0%, 100% { -webkit-transform: scale(1.05) translate(0, 0); transform: scale(1.05) translate(0, 0); }
  25% { -webkit-transform: scale(1.06) translate(-1.5%, -1%); transform: scale(1.06) translate(-1.5%, -1%); }
  50% { -webkit-transform: scale(1.07) translate(-2%, 0); transform: scale(1.07) translate(-2%, 0); }
  75% { -webkit-transform: scale(1.06) translate(-1%, 1%); transform: scale(1.06) translate(-1%, 1%); }
}
@keyframes kbDrift1 {
  0%, 100% { -webkit-transform: scale(1.05) translate(0, 0); transform: scale(1.05) translate(0, 0); }
  25% { -webkit-transform: scale(1.06) translate(-1.5%, -1%); transform: scale(1.06) translate(-1.5%, -1%); }
  50% { -webkit-transform: scale(1.07) translate(-2%, 0); transform: scale(1.07) translate(-2%, 0); }
  75% { -webkit-transform: scale(1.06) translate(-1%, 1%); transform: scale(1.06) translate(-1%, 1%); }
}

@-webkit-keyframes kbDrift2 {
  0%, 100% { -webkit-transform: scale(1.05) translate(0, 0); transform: scale(1.05) translate(0, 0); }
  25% { -webkit-transform: scale(1.06) translate(1.5%, -1%); transform: scale(1.06) translate(1.5%, -1%); }
  50% { -webkit-transform: scale(1.07) translate(2%, 0); transform: scale(1.07) translate(2%, 0); }
  75% { -webkit-transform: scale(1.06) translate(1%, 1%); transform: scale(1.06) translate(1%, 1%); }
}
@keyframes kbDrift2 {
  0%, 100% { -webkit-transform: scale(1.05) translate(0, 0); transform: scale(1.05) translate(0, 0); }
  25% { -webkit-transform: scale(1.06) translate(1.5%, -1%); transform: scale(1.06) translate(1.5%, -1%); }
  50% { -webkit-transform: scale(1.07) translate(2%, 0); transform: scale(1.07) translate(2%, 0); }
  75% { -webkit-transform: scale(1.06) translate(1%, 1%); transform: scale(1.06) translate(1%, 1%); }
}
.collection-overlay{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  z-index: 10;
}
.collection-name{
  font-weight: 700;
  font-size: 18px;
  color: white;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.collection-count{
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  margin: 4px 0 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Main list */
.list-section{ margin-top: 14px; }
.list-title{ font-size: 18px; margin: 0 0 8px; }
.card-list{
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* List header */
.list-header{
  font-size: 15px;
  color: var(--subtle);
  margin-bottom: 16px;
  font-weight: 500;
}

/* Art card with thumbnail layout */
.art-card{
  background: var(--bg);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.1s;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.art-card.has-location{
  cursor: pointer;
}
.art-card.has-location:hover{
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.art-card.has-location:active{
  transform: translateY(0);
}

/* Thumbnail */
.art-thumbnail{
  width: 64px;
  height: 64px;
  min-width: 64px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--muted);
  overflow: hidden;
}
.art-thumbnail img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Content */
.art-content{
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.art-title{
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
.art-artist{
  font-size: 13px;
  color: var(--subtle);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Type badge */
.art-type-badge{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #e5e7eb;
  color: #374151;
  margin-top: 2px;
  width: fit-content;
  align-self: flex-start;
}

.art-type-badge.sculpture{
  background: #fee2e2;
  color: #991b1b;
}

.art-type-badge.mural{
  background: #d1fae5;
  color: #065f46;
}

.art-type-badge.fountain{
  background: #dbeafe;
  color: #1e40af;
}

/* Favorite button */
.art-fav-btn{
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
  color: #9ca3af;
  border-radius: 999px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-left: auto;
}
.art-fav-btn svg{
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.art-fav-btn:hover{
  background: rgba(0,0,0,0.05);
  transform: scale(1.1);
}
.art-fav-btn.is-fav{
  color: #ef4444;
}
.art-fav-btn:active{
  transform: scale(0.9);
}

@media (prefers-color-scheme: dark){
  .art-fav-btn{
    color: #6b7280;
  }
  .art-fav-btn:hover{
    background: rgba(255,255,255,0.08);
  }
  .art-fav-btn.is-fav{
    color: #f87171;
  }
}

/* =========
   AUTH DRAWER
   ========= */
.auth-drawer{
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.auth-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}
.auth-content{
  position: relative;
  background: var(--bg);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--sheet-shadow);
  animation: slideUp 0.3s cubic-bezier(0.36, 0.66, 0.04, 1);
}
.auth-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.auth-title{
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.auth-close-btn{
  background: transparent;
  border: none;
  font-size: 32px;
  color: var(--subtle);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.auth-close-btn:hover{
  background: var(--muted);
  color: var(--text);
}
.auth-tabs{
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--muted);
}
.auth-tab{
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--subtle);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.auth-tab.active{
  color: var(--brand);
}
.auth-tab.active::after{
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand);
}
.auth-form{
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-description{
  font-size: 14px;
  color: var(--subtle);
  margin: 0 0 16px;
  line-height: 1.5;
}
.form-group{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label{
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.form-group input{
  padding: 12px 14px;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus{
  border-color: var(--brand);
}
.form-error{
  font-size: 13px;
  color: #ef4444;
  min-height: 0;
  transition: min-height 0.2s;
}
.form-error:not(:empty){
  min-height: 18px;
  margin-top: 4px;
}
.form-success{
  font-size: 13px;
  color: #10b981;
  min-height: 0;
  padding: 12px;
  background: #d1fae5;
  border-radius: 8px;
  transition: min-height 0.2s;
}
.form-success:empty{
  display: none;
}
@media (prefers-color-scheme: dark){
  .form-success{
    background: #064e3b;
    color: #6ee7b7;
  }
}
.checkbox-group{
  margin-top: 4px;
}
.checkbox-label{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"]{
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label span{
  line-height: 1.4;
}
.auth-submit-btn{
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-submit-btn:hover{
  opacity: 0.9;
}
.auth-submit-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-link-btn{
  background: transparent;
  border: none;
  color: var(--brand);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  transition: opacity 0.2s;
}
.auth-link-btn:hover{
  opacity: 0.8;
}
.loading-throbber{
  font-size: 20px;
  animation: throb 1.5s ease-in-out infinite;
}
@keyframes fadeIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}
@keyframes slideUp{
  from{
    transform: translateY(100%);
  }
  to{
    transform: translateY(0);
  }
}
@keyframes throb{
  0%, 100%{ opacity: 1; transform: scale(1); }
  50%{ opacity: 0.6; transform: scale(0.9); }
}

/* Account drawer */
.account-info{
  margin: 24px 0;
}
.account-field{
  margin-bottom: 20px;
}
.account-field label{
  font-size: 13px;
  font-weight: 600;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}
.account-value{
  font-size: 16px;
  color: var(--text);
  padding: 12px 14px;
  background: var(--muted);
  border-radius: 10px;
}
.subscription-status{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.subscription-loading{
  font-size: 14px;
  color: var(--text-secondary);
}
.subscription-text{
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.subscription-text.subscribed{
  color: #10b981;
}
@media (prefers-color-scheme: dark){
  .subscription-text.subscribed{
    color: #6ee7b7;
  }
}
.subscription-btn{
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.subscription-btn:hover{
  background: var(--muted);
}
.subscription-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
.subscription-btn.subscribe-btn{
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.subscription-btn.subscribe-btn:hover{
  opacity: 0.9;
}

/* Promo drawer */
.promo-content{
  text-align: center;
  padding: 20px 0;
}
.promo-icon{
  font-size: 64px;
  margin-bottom: 16px;
}
.promo-text{
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 24px;
}

/* Larger screens: center the drawer */
@media (min-width: 768px){
  .auth-drawer{
    align-items: center;
  }
  .auth-content{
    border-radius: 22px;
    animation: scaleIn 0.3s cubic-bezier(0.36, 0.66, 0.04, 1);
  }
  @keyframes scaleIn{
    from{
      opacity: 0;
      transform: scale(0.9);
    }
    to{
      opacity: 1;
      transform: scale(1);
    }
  }
}

/* =========
   USER LOCATION MARKER (Pulsing)
   ========= */
.user-location-marker {
  background: transparent !important;
  border: none !important;
}

.user-location-pulse {
  position: relative;
  width: 20px;
  height: 20px;
}

.pulse-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #2563eb;
  border: 3px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
  z-index: 2;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(37, 99, 235, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* =========
   ROUTE DIRECTIONS SHEET (Bottom Sheet)
   ========= */
/* Hide default routing container - we'll build custom */
.leaflet-routing-container {
  display: none !important;
}

/* Custom route sheet */
.route-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: var(--sheet-shadow);
  z-index: 15;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.36, 0.66, 0.04, 1);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.route-sheet.collapsed {
  transform: translateY(calc(100% - 80px));
}

.route-sheet-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--muted);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.route-sheet-handle {
  width: 80px;
  height: 24px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.route-sheet-handle svg{
  width: 100%;
  height: 100%;
  color: var(--subtle);
  opacity: 0.6;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg); /* Points down when expanded */
}

/* Point up when collapsed */
.route-sheet.collapsed .route-sheet-handle svg{
  transform: rotate(180deg);
}

.route-sheet-summary {
  flex: 1;
}

.route-sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-sheet-title svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.route-sheet-meta {
  font-size: 14px;
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}
.route-sheet-meta svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.route-sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--muted);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text);
  flex-shrink: 0;
  margin-left: 12px;
  transition: all 0.2s;
}

.route-sheet-close:hover {
  background: var(--brand);
  color: var(--brand-ink);
}

.route-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.route-step {
  padding: 16px 20px;
  border-bottom: 1px solid var(--muted);
  display: flex;
  gap: 16px;
}

.route-step:last-child {
  border-bottom: none;
}

.route-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  color: var(--text);
}

.route-step-icon svg {
  display: block;
}

.route-step-text {
  flex: 1;
}

.route-step-instruction {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 4px 0;
  font-weight: 500;
}

.route-step-distance {
  font-size: 13px;
  color: var(--subtle);
}

/* Loading Toast Modal */
.loading-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 32px 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--sheet-shadow);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--muted);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

/* Rounded zoom controls */
.leaflet-control-zoom {
  border: none !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.18) !important;
}

.leaflet-control-zoom a {
  border: none !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 20px !important;
  transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:first-child {
  border-top-left-radius: 999px !important;
  border-top-right-radius: 999px !important;
}

.leaflet-control-zoom a:last-child {
  border-bottom-left-radius: 999px !important;
  border-bottom-right-radius: 999px !important;
}

.leaflet-control-zoom a:hover {
  background: var(--muted) !important;
}

.leaflet-control-zoom a:active {
  transform: scale(0.95) !important;
}

.leaflet-bar {
  border: none !important;
}

/* =========
   CUSTOM MAP PINS
   ========= */
.custom-pin-marker {
  background: transparent !important;
  border: none !important;
}

.custom-map-pin {
  width: 32px;
  height: 32px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  cursor: pointer;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.custom-map-pin::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  background: inherit;
  border-radius: 50% 50% 50% 0;
  z-index: -1;
}

.pin-icon {
  /* Counter-rotate the icon so it appears upright */
  transform: rotate(45deg);
  color: white;
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  position: relative;
  z-index: 1;
}

/* =========
   ART DETAIL DRAWER
   ========= */
.art-detail-drawer{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.art-detail-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

/* Wrapper - holds buttons and content, no overflow to prevent clipping */
.art-detail-wrapper{
  position: relative;
  width: 100%;
  height: 88vh; /* Reduced on mobile to avoid browser chrome overlap */
  max-width: 100%;
  max-height: 88vh;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: var(--sheet-shadow);
  animation: slideUp 0.3s cubic-bezier(0.36, 0.66, 0.04, 1);
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Landscape mobile: reduce height to clear browser chrome */
@media (max-width: 767px) and (orientation: landscape){
  .art-detail-wrapper{
    height: 75vh;
    max-height: 75vh;
  }
}

/* Desktop: constrain width and increase height */
@media (min-width: 768px){
  .art-detail-wrapper{
    max-width: 600px;
    height: 90vh;
    max-height: 90vh;
    border-radius: 22px;
  }

  .art-detail-drawer{
    align-items: center;
  }

  .art-detail-header{
    border-radius: 22px 22px 0 0;
  }
}

/* Sticky Navigation Header */
.art-detail-header{
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  min-height: 56px;
  width: 100%;
  background: rgba(var(--bg-rgb), 0.95);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Landscape mobile: add padding to clear browser chrome */
@media (max-width: 767px) and (orientation: landscape){
  .art-detail-header{
    padding-top: 8px;
    height: 64px;
    min-height: 64px;
  }
}

/* Desktop: add glassmorphism */
@media (min-width: 768px){
  .art-detail-header{
    background: rgba(var(--bg-rgb), 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}

/* Header title - hidden by default, fades in on scroll */
.art-detail-header-title{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 120px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.art-detail-header-title.visible{
  opacity: 1;
}

@media (min-width: 768px){
  .art-detail-header-title{
    font-size: 18px;
  }
}

.art-detail-content{
  position: relative;
  background: var(--bg);
  width: 100%;
  flex: 1;
  overflow: hidden;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  min-height: 0; /* Important for flex children with scroll */
}

/* Badge floats over hero image */
.art-type-badge-floating{
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: #6b7280;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.art-type-badge-floating.mural{
  background: #10b981;
}

.art-type-badge-floating.fountain{
  background: #3b82f6;
}

.art-type-badge-floating.sculpture{
  background: #ef4444;
}

/* Header buttons */
.art-detail-close,
.art-detail-favorite{
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.art-detail-close:hover,
.art-detail-favorite:hover{
  background: var(--muted);
}

.art-detail-close:active,
.art-detail-favorite:active{
  transform: scale(0.95);
}

.art-detail-close svg,
.art-detail-favorite svg{
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.art-detail-favorite.is-fav{
  color: #ef4444;
}

@media (prefers-color-scheme: dark){
  .art-detail-favorite.is-fav{
    color: #f87171;
  }
}

.art-detail-scroll{
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  overscroll-behavior: contain;
}

/* Hero Image */
.art-hero{
  position: relative;
  width: 100%;
  height: 280px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Landscape mobile: smaller hero to fit more content */
@media (max-width: 767px) and (orientation: landscape){
  .art-hero{
    height: 200px;
  }
}

@media (min-width: 640px) and (orientation: portrait){
  .art-hero{
    height: 400px;
  }
}

@media (min-width: 768px){
  .art-hero{
    height: 400px;
  }
}

.art-hero img{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.art-hero-placeholder{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--subtle);
}

.placeholder-icon{
  font-size: 64px;
  opacity: 0.5;
}

.placeholder-text{
  font-size: 16px;
  font-weight: 500;
}

/* Type Badge in Art Detail Drawer Hero - Hidden, using floating badge instead */
.art-hero .art-type-badge{
  display: none;
}

/* Photo Credit */
.photo-credit{
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 5;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  font-size: 12px;
  color: white;
  font-weight: 500;
  line-height: 1.3;
}

.photo-credit a{
  color: #60a5fa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.photo-credit a:hover{
  color: #93c5fd;
  text-decoration: underline;
}

/* Content Body */
.art-detail-body{
  padding: 24px;
  padding-bottom: 24px;
}

.art-detail-title{
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.2;
}

.art-detail-artist{
  font-size: 18px;
  color: var(--subtle);
  margin: 0 0 16px;
}

/* Description Paragraph */
.art-description{
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 24px;
}

.art-sources{
  font-size: 14px;
  line-height: 1.5;
  color: var(--subtle);
  margin: -12px 0 24px;
}

.sources-label{
  font-weight: 500;
  color: var(--subtle);
}

.sources-value{
  color: var(--subtle);
  opacity: 0.85;
}

/* Info Boxes Grid - Responsive */
.art-info-boxes-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px){
  .art-info-boxes-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px){
  .art-info-boxes-grid{
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Gray Info Boxes */
.art-info-box{
  background: #f5f5f5;
  border-radius: 12px;
  padding: 16px;
}

@media (prefers-color-scheme: dark){
  .art-info-box{
    background: #2d2d2d;
  }
}

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

.info-box-icon{
  color: var(--subtle);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.info-box-label{
  font-size: 12px;
  font-weight: 600;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-box-value{
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

/* Sections */
.art-section{
  margin-bottom: 24px;
}

.section-title{
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.section-text{
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.art-tips{
  padding: 20px;
  background: #eff6ff;
  border-radius: 12px;
  border-left: 4px solid var(--brand);
}

@media (prefers-color-scheme: dark){
  .art-tips{
    background: #1e3a5f;
  }
}

/* Action Buttons */
.art-actions{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 80px;
}

@media (min-width: 640px){
  .art-actions{
    margin-bottom: 40px;
  }
}

.art-action-btn{
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.1s;
}

.art-action-btn:active{
  transform: scale(0.98);
}

.art-action-btn.primary{
  background: var(--brand);
  color: var(--brand-ink);
}

.art-action-btn.primary:hover{
  opacity: 0.9;
}

.art-action-btn.secondary{
  background: var(--muted);
  color: var(--text);
}

.art-action-btn.secondary:hover{
  background: #e5e7eb;
}

@media (prefers-color-scheme: dark){
  .art-action-btn.secondary:hover{
    background: #374151;
  }
}

.art-action-btn i{
  width: 20px;
  height: 20px;
}

/* Responsive styles moved to wrapper section above */

/* =========
   ACCESSIBILITY HELPERS
   ========= */
.chips-scroll::-webkit-scrollbar,
.shelf-row::-webkit-scrollbar { display: none; }

/* Small devices tightening */
@media (max-width: 360px){
  .collection-card{ width: 240px; height: 140px; }
  .fav-card{ width: 140px; }
  .fav-image{ width: 140px; height: 140px; }
}

/* Larger screens: drawer can be taller initially */
/* Removed conflicting media query - JS now controls height directly */
/* Welcome Modal */
.welcome-modal{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-backdrop{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.welcome-content{
  position: relative;
  background: var(--bg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  animation: welcomeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes welcomeSlideUp{
  from{
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-title{
  text-align: left;
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding: 40px 40px 20px;
  height: 80px;
  display: flex;
  align-items: center;
  animation: blurFadeScale 1s ease-in-out;
}

@keyframes blurFadeScale{
  0%{ opacity: 0; filter: blur(10px); transform: scale(0.9); }
  20%{ opacity: 1; filter: blur(0px); transform: scale(1); }
  80%{ opacity: 1; filter: blur(0px); transform: scale(1); }
  100%{ opacity: 0; filter: blur(10px); transform: scale(1.1); }
}

.welcome-body{
  padding: 0 40px 40px;
  animation: contentFadeIn 0.8s ease-out 0.2s both;
}

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

.welcome-intro{
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 16px 0;
}

.welcome-intro a{
  color: var(--brand);
  text-decoration: none;
}

.welcome-intro a:hover{
  text-decoration: underline;
}

.welcome-divider{
  border: none;
  border-top: 1px solid var(--muted);
  margin: 24px 0;
}

.welcome-checkbox-group{
  margin: 20px 0;
}

.welcome-checkbox-label{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.welcome-checkbox{
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.welcome-checkbox-label span{
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.welcome-continue-btn{
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  cursor: pointer;
  transition: all 0.2s;
}

.welcome-continue-btn:hover:not(:disabled){
  opacity: 0.9;
  transform: scale(1.02);
}

.welcome-continue-btn:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile adjustments */
@media (max-width: 767px){
  .welcome-content{
    width: 95%;
    max-height: 90vh;
  }

  .welcome-title{
    font-size: 32px;
    padding: 30px 20px 15px;
  }

  .welcome-body{
    padding: 0 24px 30px;
  }

  .welcome-intro{
    font-size: 15px;
  }
}
