/* ===== Base ===== */
:root{
  --bg: #f6f7fb;
  --bg-accent: #ecf0ff;
  --panel: #ffffff;
  --panel-2: #f0f3fb;
  --text: #1d2536;
  --muted: #5e6779;
  --muted-2: #788095;
  --border: #d8deec;
  --brand: #5266d4;
  --brand-2: #3348bd;
  --shadow: 0 10px 32px rgba(15, 26, 65, 0.09);
  --radius: 14px;
}

body[data-theme="dark"]{
  --bg: #0f1320;
  --bg-accent: #1b2338;
  --panel: #182034;
  --panel-2: #202a42;
  --text: #f0f3fb;
  --muted: #b2bccf;
  --muted-2: #96a2bc;
  --border: #33405f;
  --brand: #90a2ff;
  --brand-2: #6f82eb;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; max-width: 100%; overflow-x: hidden; }
body{
  margin:0;
  background:
    radial-gradient(900px 600px at 8% 2%, rgba(82,102,212,.12), transparent 40%),
    radial-gradient(1000px 600px at 95% 0%, rgba(82,102,212,.09), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
body.has-site-header{
  padding-top: 92px;
}
body.has-mobile-app-nav{
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }
img, video { display:block; max-width:100%; }
button { font-family: inherit; }

/* ===== Header ===== */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg), transparent 10%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
}

.brand{
  display:flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}
.brand__logo{
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--brand);
  font-size: 1.25rem;
}
.brand__tagline{
  color: var(--muted-2);
  font-size: .9rem;
}

.header-actions{
  display:flex;
  align-items:flex-end;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.nav-controls{
  display:flex;
  gap: 8px;
}

.search{
  width: min(540px, 100%);
  display:flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.search__label{
  font-size: .75rem;
  color: var(--muted-2);
}
#searchInput{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
}
#searchInput:focus{
  border-color: color-mix(in oklab, var(--brand), white 25%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand), transparent 83%);
}
.search-autocomplete{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 120;
  padding: .3rem;
  max-height: 260px;
  overflow: auto;
}
.search-autocomplete__item{
  display: flex;
  align-items: center;
  gap: .4rem;
  border-radius: 8px;
}
.search-autocomplete__pick{
  flex: 1;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: .46rem .52rem;
  border-radius: 8px;
  cursor: pointer;
}
.search-autocomplete__pick:hover{
  background: color-mix(in oklab, var(--panel-2), white 10%);
}
.search-autocomplete__remove{
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  line-height: 1;
  margin-right: .25rem;
}
.search-autocomplete__remove:hover{
  color: var(--text);
}

/* ===== Layout ===== */
.container{
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.intro-card{
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg-accent), white 42%), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.intro-card h1{
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.intro-card p{
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}
.hint{
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: .9rem;
}

.pill-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill-row[data-feed-tabs],
#mainFeedTabs,
#profileFeedTabs{
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--panel-2), transparent 20%);
  width: fit-content;
}
.pill{
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
}
.pill:hover{
  border-color: color-mix(in oklab, var(--brand), white 20%);
  transform: translateY(-1px);
}
.pill.is-active{
  border-color: color-mix(in oklab, var(--brand), black 8%);
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 84%), inset 0 -1px 0 rgba(255,255,255,.15);
}

/* ===== Catalog Grid ===== */
.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card{
  grid-column: span 6;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction: column;
  min-height: 100%;
}

.card__media{
  display:block;
  aspect-ratio: 16 / 10;
  overflow:hidden;
  background: var(--panel-2);
}
.card__media img{
  width:100%;
  height:100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .25s ease;
}
.card:hover .card__media img{
  transform: scale(1.07);
}

.card__body{
  padding: 14px 14px 16px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.card__top{
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card__title{
  margin:0;
  font-size: 1.1rem;
}
.badge{
  font-size: .75rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand), transparent 90%);
  border: 1px solid color-mix(in oklab, var(--brand), transparent 65%);
  color: var(--brand-2);
}

.card__desc{
  margin:0;
  color: var(--muted);
  line-height: 1.35;
}
.feed-user-avatar-link{
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.feed-user-avatar{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag-row{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag{
  font-size: .75rem;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel-2);
}

.card__actions{
  margin-top: 2px;
  display:flex;
  gap: 10px;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  background: var(--panel);
  color: var(--text);
}

/* ===== Global Nav ===== */
.global-site-header{
  z-index: 140;
}
.nav-menu-toggle{
  display: none;
}
.nav-links{
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== Cart ===== */
.cart-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

/* ===== Loading States ===== */
.skeleton{
  position: relative;
  overflow: hidden;
  background: color-mix(in oklab, var(--panel-2), var(--border) 30%);
  border-radius: 10px;
}
.skeleton::after{
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in oklab, white, transparent 55%), transparent);
  animation: skeleton-shimmer 1.25s infinite;
}
.skeleton-line{
  height: 12px;
  margin-bottom: 8px;
}
.skeleton-line.short{
  width: 62%;
}
.skeleton-media{
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 0;
}
.media-item .skeleton-media{
  aspect-ratio: 4 / 5;
}
@keyframes skeleton-shimmer{
  100%{
    transform: translateX(100%);
  }
}
.loading-spinner{
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in oklab, var(--border), transparent 10%);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin{
  to { transform: rotate(360deg); }
}
.loading-overlay{
  position: fixed;
  inset: 0;
  z-index: 300;
  background: color-mix(in oklab, var(--bg), transparent 8%);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-overlay__card{
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: .55rem .8rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ===== Cookie Consent ===== */
.cookie-consent{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(760px, calc(100vw - 24px));
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 145;
}
.cookie-consent__title{
  font-weight: 700;
  margin-bottom: 6px;
}
.cookie-consent__text{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.35;
}
.cookie-consent__actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px){
  body.has-site-header{
    padding-top: 108px;
  }
  .site-header{
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .brand{
    min-width: 0;
  }
  .brand__tagline{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-actions{
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .search{
    width: min(46vw, 220px);
  }
  .search__label{
    display: none;
  }
  #searchInput{
    padding: 9px 10px;
    font-size: .9rem;
  }
  .nav-menu-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
  }
  .nav-controls{
    position: relative;
    justify-content: flex-end;
  }
  .nav-links{
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    flex-direction: column;
    align-items: stretch;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
  }
  .nav-controls.is-open .nav-links{
    display: flex;
  }
  .nav-links .btn{
    width: 100%;
    justify-content: flex-start;
  }
  .cookie-consent{
    width: calc(100% - 14px);
    bottom: 10px;
  }
  body.has-mobile-app-nav .cookie-consent{
    bottom: calc(104px + env(safe-area-inset-bottom));
  }
  .footer-inner{
    align-items: center;
  }
  .footer-links{
    width: 100%;
    justify-content: center;
  }
}
.btn--primary{
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: color-mix(in oklab, var(--brand-2), black 20%);
  font-weight: 700;
}
.btn--primary:hover{
  filter: brightness(1.03);
}
.favorite-btn{
  border: 1px solid color-mix(in oklab, var(--brand), transparent 68%);
  background: color-mix(in oklab, var(--brand), transparent 88%);
  color: color-mix(in oklab, var(--brand-2), black 15%);
  font-weight: 700;
  transition: all .16s ease;
}
.favorite-btn:hover{
  transform: translateY(-1px);
}
.favorite-btn.is-favorited{
  border-color: #f0ba3f;
  background: linear-gradient(180deg, #ffd86b, #f0b731);
  color: #342100;
  box-shadow: 0 0 0 3px rgba(240,183,49,.25);
}
.media-like-btn,
.media-comment-btn{
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  padding: .32rem .55rem;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}
.media-like-btn.is-liked{
  border-color: #ef7a95;
  background: linear-gradient(180deg, #ff8dac, #ef6f90);
  color: #fff;
}
.media-comments-overlay{
  position: fixed;
  inset: 0;
  background: rgba(8,12,20,.84);
  z-index: 10060;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.media-comments-overlay.is-open{ display: flex; }
.media-comments-dialog{
  width: min(620px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .9rem;
}
.media-comments-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.media-comments-close{
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: .3rem .52rem;
}
.media-comments-list{ display: grid; gap: .55rem; }
.comment-item{
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  padding: .52rem .6rem;
}
.comment-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.comment-item p{ margin: .35rem 0; color: var(--text); }
.comment-reactions{ display: flex; gap: .4rem; flex-wrap: wrap; }
.comment-vote-btn{
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: .2rem .45rem;
  display: inline-flex;
  gap: .22rem;
  align-items: center;
}
.comment-vote-btn.is-active{
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand), transparent 88%);
}
.comment-delete-btn{
  border: 1px solid #b94a4a;
  color: #c25a5a;
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  padding: .2rem .35rem;
}
.media-comments-form{
  margin-top: .6rem;
  display: flex;
  gap: .45rem;
}
.media-comments-form input{
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: .45rem .5rem;
}
.media-comments-form button{
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: .42rem .6rem;
}

/* ===== Notice ===== */
.notice{
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.notice h3{
  margin:0 0 8px;
  font-size: 1rem;
}
.notice p{
  margin:0;
  color: var(--muted);
  line-height: 1.45;
}

/* ===== Footer ===== */
.site-footer{
  border-top: 1px solid var(--border);
  padding: 18px 16px;
  background: color-mix(in oklab, var(--panel-2), transparent 12%);
  overflow-x: hidden;
}
.mobile-app-nav{
  display: none;
}
.footer-inner{
  width: min(1100px, 100%);
  margin: 0 auto;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--muted-2);
}
.footer-links{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a{
  color: var(--muted-2);
}
.footer-links a:hover{
  color: var(--text);
}

/* ===== Gallery Page ===== */
.gallery-wrap{
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.gallery-head{
  display:flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 10px;
}
.gallery-title{
  margin: 0;
  font-size: 1.4rem;
}
.gallery-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 720px;
}

.back-btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.media-panel{
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.media-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.media-cell{
  grid-column: span 4;
  border-radius: 12px;
  overflow:hidden;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.media-cell img,
.media-cell video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}
.media-cell video{
  background: #000;
}

.unlock-row{
  margin-top: 14px;
  display:flex;
  justify-content: center;
}
.unlock-btn{
  width: min(420px, 100%);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--brand), black 10%);
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

/* ===== Modal ===== */
.modal{
  position: fixed;
  inset: 0;
  display:none;
  z-index: 100;
  background: rgba(3, 7, 18, .72);
  padding: 18px;
}
.modal.is-open{
  display:block;
}
.modal-card{
  width: min(560px, 100%);
  margin: 8vh auto 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-top{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.modal-title{
  margin: 0;
  font-size: 1rem;
}
.modal-close{
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor:pointer;
}
.modal-body{
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.modal-actions{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pay-btn{
  flex: 1;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--brand), black 10%);
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.cancel-btn{
  flex: 1;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

/* ===== Responsive ===== */
@media (max-width: 900px){
  .card{ grid-column: span 12; }
  .media-cell{ grid-column: span 6; }
}
@media (max-width: 560px){
  .media-cell{ grid-column: span 12; }
}

@media (max-width: 1024px) and (pointer: coarse), (max-width: 1024px) and (hover: none){
  .mobile-app-nav{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 180;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel), transparent 4%);
    backdrop-filter: blur(8px);
    width: 100%;
    max-width: 100vw;
  }
  .mobile-app-nav.is-subber{
    grid-template-columns: repeat(4, 1fr);
  }
  .mobile-app-nav__item{
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    font-size: .72rem;
    padding: .22rem .15rem;
    border-radius: 10px;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
  }
  .mobile-app-nav__item.is-active{
    color: var(--brand);
    background: color-mix(in oklab, var(--brand), transparent 88%);
  }
  .mobile-app-nav__item.is-active .mobile-app-nav__icon{
    transform: translateY(-1px);
  }
  .mobile-app-nav__icon{
    font-size: 1.15rem;
    line-height: 1;
    transition: transform .16s ease, color .16s ease;
  }
  .mobile-app-nav__item--plus .mobile-app-nav__icon{
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
    color: #fff;
  }
  .mobile-app-nav__item--plus.is-active{
    background: transparent;
    color: color-mix(in oklab, var(--brand), white 10%);
  }
  .mobile-app-nav__item--plus.is-active .mobile-app-nav__icon{
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 80%);
  }
}

.global-upload-overlay{
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, .84);
  z-index: 10080;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.global-upload-overlay.is-open{
  display: flex;
}
.global-upload-dialog{
  width: min(560px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .95rem;
}
.global-upload-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
}
.global-upload-close{
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: .3rem .52rem;
  cursor: pointer;
}
.global-upload-form{
  display: grid;
  gap: .55rem;
}
.global-upload-form label{
  display: grid;
  gap: .3rem;
  color: var(--muted-2);
  font-size: .92rem;
}
.global-upload-form input[type="text"],
.global-upload-form input[type="number"],
.global-upload-form input[type="file"],
.global-upload-form textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .48rem .56rem;
  background: var(--panel-2);
  color: var(--text);
}
.global-upload-options{
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.global-upload-options label{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.global-upload-options input[type="number"]{
  width: 100px;
}
.global-upload-actions{
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.upload-toast{
  position: fixed;
  right: 12px;
  bottom: 14px;
  z-index: 10120;
  width: min(360px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .6rem .68rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .56rem;
  align-items: start;
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transition: opacity .18s ease, transform .18s ease;
}
.upload-toast.is-visible{
  opacity: 1;
  transform: translateY(0) scale(1);
}
.upload-toast.is-error{
  border-left-color: #c25a5a;
}
.upload-toast__icon{
  font-size: 1.1rem;
  line-height: 1;
  margin-top: .1rem;
  animation: upload-toast-clink .9s ease-out 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.upload-toast__body{
  display: grid;
  gap: .18rem;
}
.upload-toast__body strong{
  font-size: .9rem;
}
.upload-toast__body span{
  font-size: .84rem;
  color: var(--muted);
}
.upload-toast__close{
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  padding: .12rem .38rem;
  line-height: 1.1;
}
@keyframes upload-toast-clink{
  0%{ transform: rotate(-8deg) translateY(-1px); opacity: .2; }
  45%{ transform: rotate(6deg) translateY(0); opacity: 1; }
  100%{ transform: rotate(0deg) translateY(0); opacity: 1; }
}
body.has-mobile-app-nav .upload-toast{
  bottom: calc(104px + env(safe-area-inset-bottom));
}

/* Global checkbox-to-slider styling */
label:has(> input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: .52rem;
}
input[type="checkbox"]{
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(90, 103, 146, .38);
  background: linear-gradient(180deg, rgba(110,120,148,.25), rgba(78,86,112,.2));
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.18);
  cursor: pointer;
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
  vertical-align: middle;
}
input[type="checkbox"]::after{
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dce3ff);
  box-shadow: 0 2px 5px rgba(13, 18, 34, .35);
  transition: transform .24s cubic-bezier(.2,.8,.2,1), background .2s ease;
}
input[type="checkbox"]:checked{
  background: linear-gradient(180deg, #4f63cf, #637de4);
  border-color: rgba(99,125,228,.88);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.24), 0 0 0 3px rgba(99,125,228,.18);
}
input[type="checkbox"]:checked::after{
  transform: translateX(18px);
  background: linear-gradient(180deg, #ffffff, #f0f4ff);
}
input[type="checkbox"]:disabled{
  opacity: .52;
  cursor: not-allowed;
}
