/* Shared layout rules follow both appearance styles. */
.section-heading > div,.section-controls,.communities,.raffles,.community-profile > div,
.raffle-row > div,.nft-details,.dialog-body,.phase-copy,.search-result > span,
.form-field,.theme-option { min-width: 0; }
.search-input-wrap input { flex: 1; min-width: 0; width: auto; }
.dialog-grid { grid-template-columns: minmax(0,.9fr) minmax(0,1fr); }
.dialog-body :is(h2,h3,p,strong),.search-result strong { overflow-wrap: anywhere; }
.detail-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.phase-copy { flex: 1; }
.phase-price,.phase-number,.settings-row input { flex-shrink: 0; }
.dialog-close { position: sticky; top: 12px; right: auto; float: right; margin: 12px 12px -56px 0; width: 44px; height: 44px; z-index: 5; }
.dialog-body .button { min-height: 44px; white-space: normal; text-align: center; line-height: 1.4; padding-block: 10px; }
.quantity-control { gap: 12px; }
.quantity-control > span { flex: 1; min-width: 0; line-height: 1.5; }
.quantity-control button { width: 44px; height: 44px; flex-shrink: 0; }
.quantity-control output { min-width: 20px; text-align: center; }
.mini-collection-row > div:not(.nft-art) { flex: 1; min-width: 0; }
.dialog-shell { scroll-padding-block: 65px 24px; }
.menu-utilities { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.menu-utility { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.menu-utility svg { width: 18px; height: 18px; }
.menu-utility:hover { background: #95bf6720; }
.header-actions { flex-shrink: 0; }
.site-header,.hero-feature { overflow: clip; }

/* Balance navigation between the brand and utilities, with one shared centerline. */
@media(min-width:701px) {
  .site-header .desktop-nav { margin-inline: auto; }
  .site-header .desktop-nav a { align-items: center; display: inline-flex; min-height: 40px; padding-block: 0; line-height: 1; }
  .site-header .header-actions { margin-left: 0; }
}
@media(min-width:701px) and (max-width:1000px) {
  .site-header .desktop-nav a:nth-child(n+3) { display: none; }
}
@media(min-width:1001px) and (max-width:1400px) {
  .site-header { gap: 18px; }
  .site-header .desktop-nav { gap: 18px; }
  .site-header .desktop-nav a { white-space: nowrap; }
}
.hero-feature { display: grid; grid-template-columns: 80px minmax(0,1fr); align-items: center; gap: 12px; clip-path: inset(0 round 23px); }
.hero-feature .feature-art { display: block; width: 100%; height: auto; min-height: 0; aspect-ratio: 1; align-self: center; background-size: cover; background-position: center; }
.hero-feature .feature-copy { padding: 0; }
.hero-feature .feature-meta { flex-wrap: nowrap; line-height: 1.5; }
.hero-feature .feature-price { white-space: nowrap; }
.hero-feature .feature-open { grid-column: 1 / -1; width: 100%; min-height: 44px; margin: 0; padding: 10px 16px; font-size: 12px; gap: 10px; }
@media(min-width:701px) and (max-width:1000px) { .hero-feature { grid-template-columns: 64px minmax(0,1fr); gap: 10px; } }
@media(max-width:700px) { .hero-feature { grid-template-columns: 72px minmax(0,1fr); gap: 10px; clip-path: inset(0 round 20px); } }

@media(min-width:1700px) { .site-header { max-width: 1640px; margin-inline: auto; } }

/* Tablet navigation retains every destination, including after rotation. */
@media(max-width:1000px) {
  .menu-trigger { display: grid; }
  .header-actions .icon-button,.header-actions .wallet-trigger { width: 44px; height: 44px; min-height: 44px; padding: 0; }
  .header-actions .network-button { display: none; }
  .header-actions .wallet-trigger > span { display: none; }
  .header-actions .wallet-small { display: block; width: 18px!important; height: 18px!important; }
  .mobile-nav { display: grid; position: absolute; z-index: 21; top: 91px; left: 3%; right: 3%; border-radius: 20px; padding: 12px; max-height: calc(100dvh - 105px); overflow-y: auto; overscroll-behavior: contain; }
  .mobile-nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 15px; }
  .mobile-nav a:hover { background: #95bf6720; }
  html[data-theme=dark] .mobile-nav { background: #0d1815f2; border-color: #bfdbaa36; }
  .collection-open { width: 44px; height: 44px; }
  .collection-info,.collection-card:not(.first-card) .collection-info { gap: 7px; }
  .collection-title > button { white-space: normal; text-align: left; line-height: 1.25; }
  .collection-title p { line-height: 1.4; }
  .raffle-row .button { min-height: 44px; white-space: normal; }
  .nft-price-row .button { min-height: 40px; min-width: 44px; }
  .community-bottom .text-link { min-height: 40px; }
  .form-field input,.form-field select,.form-field textarea,.search-input-wrap input { font-size: 16px; }
}

@media(min-width:701px) and (max-width:900px) {
  .dialog-grid { grid-template-columns: 1fr; }
  .dialog-art { min-height: 235px; height: 235px; border-radius: 27px 27px 0 0; background-position: center 32%; }
  .dialog-grid .dialog-body { padding: 30px; }
  .raffle-list { grid-template-columns: 1fr; }
  .raffle-row .button svg { display: block; }
}

@media(max-width:700px) {
  :root { scroll-padding-top: 24px; }
  .site-header { gap: 6px; min-height: 64px; padding: 7px 10px; }
  .header-actions { gap: 3px; }
  .site-header .search-trigger { display: none; }
  .mobile-nav { top: 85px; left: 12px; right: 12px; max-height: calc(100dvh - 97px); }
  .hero-copy { left: 0; max-width: 100%; }
  .hero-actions { flex-wrap: wrap; gap: 10px 18px; }
  .hero-actions .button,.hero-actions .text-link { min-height: 44px; }
  .hero-pagination { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 12px; width: 100%; max-width: 320px; }
  .hero-pagination .round-button { width: 44px; height: 44px; }
  .hero-pagination .hero-prev { grid-column: 1; grid-row: 1; }
  .hero-pagination .hero-next { grid-column: 3; grid-row: 1; }
  .hero-pagination .slide-label { grid-column: 2; grid-row: 1; align-self: start; margin-top: 5px; font-size: 9px; letter-spacing: .13em; text-align: center; }
  .hero-pagination .slide-tracks { grid-column: 2; grid-row: 1; align-self: end; justify-self: center; width: 90px; gap: 5px; margin-bottom: 0; }
  .hero-pagination .slide-track { min-width: 24px; height: 24px; }
  .hero-pagination:before { inset: -4px; }
  .feature-copy .button { min-height: 44px; }
  .featured .section-controls { flex-wrap: wrap; gap: 10px; }
  .segmented button { min-height: 40px; padding: 8px 15px; }
  .view-all-drops { min-height: 40px; }
  .collection-info,.collection-card:not(.first-card) .collection-info { padding: 19px 12px 14px 65px; }
  .collection-title > button { font-size: 20px; }
  .collection-emblem { left: 12px; }
  .community-profile h3 button { min-height: 32px; text-align: left; }
  .community-profile p { margin-top: 1px; }
  .raffle-row { gap: 10px; padding: 10px; }
  .raffle-row h3 { font-size: 13px; }
  .raffle-row .button { padding-inline: 12px; font-size: 12px; }
  .marketplace .section-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(135px,.7fr); gap: 10px; }
  .market-search { min-height: 44px; padding: 10px 12px; }
  .market-search input { font-size: 16px; min-width: 0; }
  .sort-control { min-width: 0; }
  .sort-control select { width: 100%; max-width: none; min-height: 44px; font-size: 16px; padding: 8px 10px; }
  .market-tabs button { min-height: 44px; font-size: 13px; }
  .nft-price-row { flex-wrap: wrap; }
  .nft-price-row .button { min-height: 44px; font-size: 12px; }
  .footer nav { flex-wrap: wrap; gap: 4px 20px; }
  .footer nav button { min-height: 44px; }
  .footer-tagline { white-space: normal; }
  .dialog-shell { max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .dialog-grid { grid-template-columns: minmax(0,1fr); }
  .dialog-close { position: sticky; top: 10px; right: auto; float: right; margin: 10px 10px -54px 0; }
  .dialog-body { padding: 36px 22px 26px; }
  .dialog-grid .dialog-body { padding: 25px 22px; }
  .dialog-body .button { min-height: 44px; }
  .mini-collection-row { flex-wrap: wrap; }
  .mini-collection-row .button { margin-left: 0; }
  .requirement-row { min-height: 48px; }
  .settings-row { min-height: 60px; }
}

@media(max-width:400px) {
  .site-header { gap: 4px; }
  .site-header .brand { font-size: 21px; gap: 3px; }
  .site-header .brand-symbol,.site-header .brand-symbol svg { width: 25px; height: 29px; }
  .hero h1 { font-size: clamp(31px,9.45vw,38px); }
  .hero-actions { gap: 6px 14px; }
  .hero-actions .text-link { font-size: 12px; }
  .hero-actions .button { padding-inline: 15px; font-size: 12px; }
  .hero-feature { max-width: 100%; }
  .featured .segmented button { padding-inline: 12px; }
  .collection-info,.collection-card:not(.first-card) .collection-info { padding: 23px 12px 12px; }
  .collection-emblem { width: 39px; height: 39px; }
  .collection-title > button { font-size: 19px; }
  .collection-title p { font-size: 11px; }
  .raffle-row { display: grid; grid-template-columns: 40px minmax(0,1fr); }
  .raffle-row .button { grid-column: 2; justify-self: start; margin-left: 0; }
  .marketplace .section-controls { grid-template-columns: 1fr; }
  .footer-tagline { border-left: 0; padding-left: 0; }
}
@media(max-width:350px) {
  .site-header .brand { font-size: 18px; }
  .site-header .brand-symbol,.site-header .brand-symbol svg { width: 23px; }
  .header-actions { gap: 2px; }
  .nft-details { padding: 10px; }
  .nft-price-row .button { width: 100%; }
  .community-bottom { flex-wrap: wrap; gap: 4px 15px; }
  .form-grid { gap: 15px; }
  .theme-options { gap: 10px; }
}

/* Short landscape windows keep the dialog's content and dismissal reachable. */
@media(max-height:500px) {
  .dialog-shell { max-height: calc(100dvh - 16px); }
  .dialog-shell[open] { animation-name: dialog-fade-in; }
  .dialog-art { min-height: 145px; height: 145px; }
}
@keyframes dialog-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media(min-width:701px) and (max-height:500px) {
  .dialog-grid { grid-template-columns: minmax(0,.65fr) minmax(0,1fr); }
  .dialog-art { height: auto; min-height: 280px; border-radius: 27px 0 0 27px; }
  .dialog-grid .dialog-body { padding: 32px 24px 24px; }
}
@media(prefers-reduced-transparency:reduce) {
  html[data-theme=dark] .mobile-nav { background: #111a18; }
}
html[data-theme=dark].low-effects .mobile-nav { background: #111a18; }

/* Room for Social without crowding the shared navigation. */
@media(min-width:1001px) and (max-width:1300px) { .site-header { gap:18px; }.desktop-nav { gap:18px; margin-left:0; font-size:12px; }.header-actions { gap:10px; }.site-header .network-button { display:none; } }
