:root {
  --bg: #0f0f12;
  --surface: #1a1a20;
  --surface-2: #25252e;
  --text: #f4f4f6;
  --muted: #9a9aa6;
  --accent: #ff5a7a;
  --like: #2ee6a6;
  --skip: #ff5a7a;
  --radius: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: radial-gradient(120% 80% at 50% -10%, #1c1c26 0%, var(--bg) 55%);
  overflow: hidden;
}

/* Header */
.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 6px;
  flex: 0 0 auto;
}
.app__brand { display: flex; align-items: center; gap: 8px; }
.app__logo { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.app__logo:active { transform: scale(.97); }
.app__mark { flex: 0 0 auto; display: block; border-radius: 9px; box-shadow: 0 4px 12px rgba(255,90,122,.35); }
.app__name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.app__dot { color: var(--accent); }
.app__head-right { display: flex; align-items: center; gap: 10px; }
.chip-city {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: none; color: var(--text);
  font-size: 13px; font-weight: 600;
  padding: 8px 13px; border-radius: 100px; cursor: pointer;
}
.chip-city svg { color: var(--accent); }
.iconbtn {
  position: relative;
  background: var(--surface); border: none; color: var(--text);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.iconbtn__badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 100px; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.iconbtn__dot {
  position: absolute; top: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}

/* Views */
.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.is-active { display: flex; }

/* Tabs */
.tabs { position: relative; display: flex; gap: 4px; padding: 8px 16px 8px; flex: 0 0 auto; }
.tabs__btn {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 13.5px; font-weight: 600; padding: 8px 4px; cursor: pointer;
  transition: color .25s ease; white-space: nowrap;
}
.tabs__btn.is-active { color: var(--text); }
.tabs__ink {
  position: absolute; bottom: 4px; height: 3px; border-radius: 3px;
  background: var(--accent);
  transition: transform .3s cubic-bezier(.5,.05,.2,1), width .3s cubic-bezier(.5,.05,.2,1);
}

/* Topic chips */
.topics {
  display: flex; gap: 8px; padding: 4px 16px 10px;
  overflow-x: auto; scrollbar-width: none; flex: 0 0 auto;
}
.topics::-webkit-scrollbar { display: none; }
.topic {
  flex: 0 0 auto; background: var(--surface); border: 1px solid transparent;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 100px; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.topic.is-active { background: rgba(255,90,122,.16); color: var(--accent); border-color: rgba(255,90,122,.5); }

/* Stage / cards */
.stage { position: relative; flex: 1; min-height: 0; }
.card {
  position: absolute; inset: 4px 18px 12px;
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  will-change: transform; touch-action: pan-y; user-select: none; cursor: grab;
}
.card:active { cursor: grabbing; }
.card__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none; background: var(--surface-2);
}
.card__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.18) 42%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.card__meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 22px 22px; pointer-events: none; }
.card__tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; padding: 5px 11px; border-radius: 100px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px); margin-bottom: 10px;
}
.card__city {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 8px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.85);
}
.card__title { font-size: 25px; font-weight: 800; line-height: 1.12; letter-spacing: -.4px; }
.card__sub { margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.82); line-height: 1.35; }
.card__cta {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--accent); padding: 9px 16px; border-radius: 100px;
  pointer-events: auto; border: none; cursor: pointer; text-decoration: none;
}

/* Affiliate offer / urgency */
.card__deal {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  font-size: 15px; font-weight: 900; letter-spacing: .3px; color: #fff;
  background: var(--accent); padding: 7px 12px; border-radius: 12px;
  box-shadow: 0 6px 16px rgba(255,90,122,.45);
}
.card__offer { margin-top: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.offer__price { font-size: 19px; font-weight: 800; color: #fff; }
.offer__was { margin-left: 6px; font-size: 14px; color: rgba(255,255,255,.6); text-decoration: line-through; }
.offer__ends {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: #ffd7a0;
  background: rgba(0,0,0,.35); padding: 4px 10px; border-radius: 100px;
}
.offer__ends.is-ended { color: rgba(255,255,255,.55); }

/* Moodboard shoppable grid */
.mood__board {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px;
  font-size: 13px; font-weight: 700; color: #fff; text-decoration: none;
  background: var(--accent); padding: 10px 16px; border-radius: 100px;
}
.mood__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; overflow-y: auto; min-height: 0; }
/* Make the grid the scrollable region inside the height-capped sheet panel.
   Without this, `.sheet__panel > * { flex:0 0 auto }` pins it to content height
   so >3 items overflow instead of scrolling. */
.sheet__panel > .mood__grid { flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.mood__item {
  display: flex; flex-direction: column; background: var(--surface-2);
  border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text);
}
.mood__item:active { transform: scale(.98); }
.mood__img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #222; }
.mood__info { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mood__label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.mood__price { font-size: 13px; font-weight: 800; color: #fff; }
.mood__shop { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--accent); }

/* Upload form: multi-topic picker */
.topicpick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.topicpick__chip {
  background: var(--surface); border: 1px solid #2c2c36; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 100px;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
.topicpick__chip.is-on { background: rgba(255,90,122,.16); color: var(--accent); border-color: rgba(255,90,122,.5); }
.topicpick__chip:active { transform: scale(.97); }

/* Upload form: offer fieldset */
.form__offer { border: 1px solid #2c2c36; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.form__offer legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.form__row2 { display: flex; gap: 10px; }
.form__row2 > label { flex: 1; }

/* Swipe stamps */
.card__stamp {
  position: absolute; top: 26px; font-size: 24px; font-weight: 900; letter-spacing: 2px;
  padding: 6px 16px; border-radius: 12px; border: 4px solid; opacity: 0;
  transition: opacity .12s linear; pointer-events: none;
}
.card__stamp--like { left: 22px; color: var(--like); border-color: var(--like); transform: rotate(-14deg); }
.card__stamp--skip { right: 22px; color: var(--skip); border-color: var(--skip); transform: rotate(14deg); }

.deck__empty {
  position: absolute; inset: 4px 18px 12px; border-radius: var(--radius);
  display: none; place-items: center; text-align: center; background: var(--surface); padding: 30px;
}
.deck__empty.is-show { display: grid; }
.deck__empty h3 { font-size: 19px; margin-bottom: 8px; }
.deck__empty p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.deck__empty button {
  background: var(--accent); color: #fff; border: none; font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: 100px; cursor: pointer;
}
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

/* Style Me booking panel */
.styleme { position: absolute; inset: 0; overflow-y: auto; padding: 6px 18px 18px; }
.styleme__hero {
  background: linear-gradient(135deg, rgba(255,90,122,.22), rgba(255,138,90,.12));
  border: 1px solid rgba(255,90,122,.3); border-radius: 18px; padding: 18px; margin-bottom: 18px;
}
.styleme__hero h2 { font-size: 23px; font-weight: 800; letter-spacing: -.4px; }
.styleme__hero p { font-size: 13.5px; color: rgba(255,255,255,.82); margin-top: 6px; line-height: 1.4; }
.styleme__h { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 4px 2px 10px; }
.styleme__services { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.svc {
  text-align: left; background: var(--surface); border: 1.5px solid transparent; color: var(--text);
  border-radius: 14px; padding: 13px 14px; cursor: pointer; display: block;
}
.svc.is-sel { border-color: var(--accent); background: rgba(255,90,122,.1); }
.svc__title { display: block; font-size: 15px; font-weight: 700; }
.svc__desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.styleme__stylists { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; padding-bottom: 2px; }
.styleme__stylists::-webkit-scrollbar { display: none; }
.sty {
  flex: 0 0 auto; width: 96px; background: var(--surface); border: 1.5px solid transparent;
  border-radius: 14px; padding: 10px; cursor: pointer; text-align: center; color: var(--text);
}
.sty.is-sel { border-color: var(--accent); background: rgba(255,90,122,.1); }
.sty img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.sty__any { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto; font-weight: 800; color: var(--muted); }
.sty__name { display: block; font-size: 12px; font-weight: 700; margin-top: 7px; }
.sty__spec { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.styleme__form input, .styleme__form textarea {
  width: 100%; background: var(--surface); border: 1px solid #2c2c36; color: var(--text);
  font-size: 15px; padding: 12px 13px; border-radius: 12px; outline: none; margin-bottom: 10px;
  -webkit-appearance: none; appearance: none; font-family: inherit; resize: vertical;
}
.styleme__form input:focus, .styleme__form textarea:focus { border-color: var(--accent); }
.styleme__row { display: flex; gap: 10px; }
.styleme__row input { flex: 1; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; margin: 0 !important; }
.booked { text-align: center; padding: 40px 24px; }
.booked__check { width: 64px; height: 64px; border-radius: 50%; background: var(--like); color: #06281d; font-size: 34px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 18px; }
.booked h2 { font-size: 22px; font-weight: 800; }
.booked p { color: rgba(255,255,255,.85); font-size: 14px; margin-top: 8px; line-height: 1.45; }
.booked__sub { color: var(--muted) !important; font-size: 12.5px !important; }
.booked .form__submit { margin-top: 22px; max-width: 220px; margin-left: auto; margin-right: auto; }

/* Bookings (admin) */
.bk { background: var(--surface); border-radius: 14px; padding: 13px; margin-bottom: 12px; }
.bk__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bk__name { font-size: 15px; font-weight: 700; }
.bk__svc { font-size: 12.5px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.bk__status { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 4px 9px; border-radius: 100px; }
.bk__status--requested { background: var(--surface-2); color: var(--muted); }
.bk__status--confirmed { background: rgba(46,230,166,.14); color: var(--like); }
.bk__status--declined { background: rgba(255,90,122,.14); color: var(--skip); }
.bk__meta { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.bk__meta b { color: var(--text); font-weight: 600; }
.bk__notes { font-size: 12.5px; color: rgba(255,255,255,.78); margin-top: 6px; font-style: italic; }
.bk__actions { display: flex; gap: 8px; margin-top: 11px; }
.bk__btn { font-size: 12.5px; font-weight: 700; border: none; border-radius: 9px; padding: 8px 14px; cursor: pointer; }
.bk__btn--confirm { background: rgba(46,230,166,.16); color: var(--like); }
.bk__btn--decline { background: rgba(255,90,122,.14); color: var(--skip); }

/* Action bar */
.actions {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 10px 0 12px; flex: 0 0 auto;
}
.actions__btn {
  border: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: 0 6px 16px rgba(0,0,0,.35);
  transition: transform .15s ease;
}
.actions__btn:active { transform: scale(.9); }
.actions__btn--skip { width: 56px; height: 56px; color: var(--skip); }
.actions__btn--like { width: 56px; height: 56px; color: var(--like); }
.actions__btn--info { width: 46px; height: 46px; color: var(--muted); }

/* Sub-header (wishlist / upload) */
.subhead { display: flex; align-items: center; gap: 10px; padding: 8px 14px 12px; flex: 0 0 auto; }
.subhead h2 { font-size: 19px; font-weight: 800; flex: 1; }
.subhead__add {
  background: var(--accent); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}
.subhead__refresh {
  background: var(--surface); border: 1px solid #2c2c36; color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}
.subhead__refresh.is-loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.subhead__pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid #2c2c36; color: var(--text);
  font-size: 13px; font-weight: 700; padding: 8px 13px; border-radius: 100px; cursor: pointer;
}
.subhead__pill:active { transform: scale(.97); }
.backbtn {
  background: var(--surface); border: none; color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}

/* Lists (wishlist) */
.list { flex: 1; overflow-y: auto; padding: 0 14px 16px; }
.list__empty { text-align: center; color: var(--muted); padding: 60px 24px; font-size: 14px; }
.litem {
  display: flex; gap: 12px; background: var(--surface); border-radius: 16px;
  padding: 10px; margin-bottom: 12px; align-items: center;
}
.litem__img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.litem__body { flex: 1; min-width: 0; }
.litem__title { font-size: 15px; font-weight: 700; }
.litem__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.litem__row { display: flex; gap: 8px; margin-top: 10px; }
.litem__go { font-size: 12px; font-weight: 700; color: var(--accent); text-decoration: none; }
button.litem__go { background: none; border: none; padding: 0; cursor: pointer; }
.litem--compact { align-items: flex-start; }
.litem--compact .litem__sub { white-space: normal; word-break: break-all; }
.litem__rm { font-size: 12px; font-weight: 600; color: var(--muted); background: none; border: none; cursor: pointer; }
.litem__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.litem__pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 100px;
}
.litem__pill--clicks { color: var(--like); }
.litem__pill--city { color: var(--accent); text-transform: none; }
.litem__edit, .litem__del {
  font-size: 15px; font-weight: 700; cursor: pointer;
  padding: 8px 16px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid transparent; line-height: 1;
}
.litem__edit { color: #e7e7f2; }
.litem__del { color: var(--skip); }
.litem__edit:active { background: #30303c; }
.litem__del:active { background: rgba(255,90,122,.16); border-color: rgba(255,90,122,.4); }

/* Manage search bar */
.list__searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 12px;
  padding: 0 12px; margin-bottom: 12px;
}
.list__search-icon { color: var(--muted); flex: 0 0 auto; }
.list__search {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit; padding: 12px 0;
  -webkit-appearance: none; appearance: none;
}
.list__search::placeholder { color: var(--muted); }
.list__search::-webkit-search-cancel-button { -webkit-appearance: none; }
.list__count { font-size: 12px; color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* Form */
.form { flex: 1; overflow-y: auto; padding: 0 16px 24px; }
.form label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.form .hint { font-weight: 500; opacity: .8; }
.form input, .form select, .form textarea {
  display: block; width: 100%; margin-top: 6px;
  background: var(--surface); border: 1px solid #2c2c36; color: var(--text);
  font-size: 15px; padding: 12px 13px; border-radius: 12px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form textarea { font-family: inherit; resize: vertical; line-height: 1.4; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
/* Native file inputs are driven by custom buttons (Upload / row tile) — keep them
   hidden. Needed because `.form input { display:block }` overrides the [hidden] attr. */
.form input[type="file"] { display: none; }
.form select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239a9aa6' stroke-width='2'><path d='M3 5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
.form__submit {
  width: 100%; background: var(--accent); color: #fff; border: none;
  font-size: 15px; font-weight: 700; padding: 14px; border-radius: 14px; cursor: pointer; margin-top: 4px;
}

/* File picker */
.filepick { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.filepick__btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); color: var(--text); border: 1px solid #2c2c36;
  font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.filepick__btn:active { transform: scale(.97); }
.filepick__preview { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }

/* Moodboard "shop the look" item editor */
.moodedit { border: 1px solid #2c2c36; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.moodedit__legend { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.moodrow { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.moodrow__pick {
  flex: 0 0 auto; position: relative; width: 60px; height: 60px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed #3a3a46; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0;
}
.moodrow__pick:active { transform: scale(.97); }
.moodrow__img { width: 100%; height: 100%; object-fit: cover; }
.moodrow__plus { font-size: 24px; font-weight: 300; color: var(--muted); line-height: 1; }
.moodrow__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.moodrow__two { display: flex; gap: 8px; }
.moodrow__price { flex: 0 0 38%; min-width: 0; }
.moodrow__url { flex: 1; min-width: 0; }
.moodrow__del {
  flex: 0 0 auto; align-self: center; width: 30px; height: 30px; border-radius: 8px;
  background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer;
}
.moodrow__del:active { background: rgba(255,90,122,.16); color: var(--skip); }
.moodedit__add {
  background: var(--surface-2); color: var(--text); border: 1px solid #2c2c36;
  font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 10px; cursor: pointer;
}
.moodedit__add:active { transform: scale(.97); }

/* Analytics */
.seg {
  display: flex; gap: 4px; background: var(--surface); border-radius: 12px;
  padding: 4px; margin-bottom: 18px;
}
.seg__btn {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 12.5px; font-weight: 700; padding: 8px 4px; border-radius: 9px; cursor: pointer;
  transition: background .2s, color .2s;
}
.seg__btn.is-active { background: var(--accent); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border-radius: 16px; padding: 14px 12px; text-align: center;
}
.stat__num { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat__num.is-accent { color: var(--like); }
.stat__label { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.an-section { margin-bottom: 26px; }
.an-section h3 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.trend { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding: 4px 0; }
.trend__bar {
  flex: 1 1 0; min-width: 0; min-height: 4px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #ff5a7a, #ff8a5a);
}
.trend__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bar-row__label { width: 92px; flex: 0 0 auto; font-size: 12.5px; font-weight: 600; }
.bar-row__track { flex: 1; height: 22px; background: var(--surface); border-radius: 7px; overflow: hidden; }
.bar-row__fill {
  display: block; height: 100%; border-radius: 7px; min-width: 3px;
  background: linear-gradient(90deg, #ff5a7a, #ff8a5a);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.bar-row__val { width: 34px; flex: 0 0 auto; text-align: right; font-size: 12.5px; font-weight: 700; }
.lead {
  display: flex; align-items: center; gap: 11px; background: var(--surface);
  border-radius: 14px; padding: 9px 11px; margin-bottom: 10px;
}
.lead__rank { width: 20px; flex: 0 0 auto; font-size: 14px; font-weight: 800; color: var(--muted); text-align: center; }
.lead__img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.lead__body { flex: 1; min-width: 0; }
.lead__title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead__bartrack { height: 6px; background: var(--surface-2); border-radius: 6px; margin-top: 6px; overflow: hidden; }
.lead__barfill { height: 100%; border-radius: 6px; background: var(--like); }
.lead__clicks { flex: 0 0 auto; text-align: right; }
.lead__clicks b { font-size: 16px; font-weight: 800; color: var(--like); }
.lead__clicks span { display: block; font-size: 10px; color: var(--muted); }

/* Feed manager */
.feedform { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 20px; }
.feedform__row { display: flex; gap: 8px; margin-bottom: 10px; }
.feedform select, .feedform input {
  width: 100%; background: var(--surface-2); border: 1px solid #2c2c36; color: var(--text);
  font-size: 14px; padding: 11px; border-radius: 10px; outline: none; -webkit-appearance: none; appearance: none;
}
.feedform select:focus, .feedform input:focus { border-color: var(--accent); }
.feedform__row select { flex: 0 0 44%; }
.feedform input[name=url] { margin-bottom: 10px; }
.feedform__actions { display: flex; gap: 8px; }
.feedform__actions .form__submit { flex: 1; margin: 0; }
.feedform__test {
  flex: 0 0 auto; background: var(--surface-2); border: 1px solid #2c2c36; color: var(--text);
  font-size: 14px; font-weight: 700; padding: 14px 18px; border-radius: 14px; cursor: pointer;
}
.feedtest { font-size: 12.5px; font-weight: 600; padding: 9px 11px; border-radius: 10px; margin-bottom: 10px; line-height: 1.4; }
.feedtest.loading { background: var(--surface-2); color: var(--muted); }
.feedtest.ok { background: rgba(46,230,166,.12); color: var(--like); }
.feedtest.err { background: rgba(255,90,122,.12); color: var(--skip); }
.feeds-h { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 4px 4px 12px; }

/* API source panels */
.src { background: var(--surface); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.src .feeds-h { margin: 0 0 8px; }
.src__hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.src__hint b { color: var(--text); font-weight: 600; }
.src__status { font-size: 13px; font-weight: 600; }
.src__ok { color: var(--like); }
.src__warn { color: var(--skip); }
.src .feedform { background: none; padding: 0; margin: 0; }
.src__status { line-height: 1.5; }

/* Auto-refresh controls */
.auto__row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin-bottom: 10px; }
.auto__row input[type=number] { padding: 7px 8px; border-radius: 9px; border: 1px solid #2c2c36; background: var(--surface-2); color: var(--text); font: inherit; }
.auto__row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.auto__cities { margin: 4px 0 6px; }
.auto__cities .src__hint { margin-bottom: 8px; }
.auto__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.auto__chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text);
  background: var(--surface-2); border: 1px solid #2c2c36; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.auto__chip input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }

/* Bottom nav */
.bottomnav {
  display: flex; align-items: center; justify-content: space-around;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(20,20,26,.92); backdrop-filter: blur(10px);
  border-top: 1px solid #22222b; flex: 0 0 auto;
}
.bottomnav__btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 6px 14px;
}
.bottomnav__btn.is-active { color: var(--text); }
.bottomnav__icon { position: relative; display: grid; place-items: center; }
.bottomnav__badge {
  position: absolute; top: -5px; right: -9px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 100px; display: grid; place-items: center;
  border: 2px solid rgba(20,20,26,.92);
}
.bottomnav__add {
  background: var(--accent); color: #fff; width: 52px; height: 52px;
  border-radius: 50%; justify-content: center; margin-top: -14px;
  box-shadow: 0 8px 20px rgba(255,90,122,.4);
}
.bottomnav__add.is-active { color: #fff; }

/* Upload entry point is admin-only — hidden until signed in */
.bottomnav__add { display: none; }
body.is-admin .bottomnav__add { display: flex; }

/* Admin sheet */
.admin-input {
  width: 100%; background: var(--surface-2); border: 1px solid #2c2c36; color: var(--text);
  font-size: 16px; padding: 13px; border-radius: 12px; outline: none; margin-bottom: 12px;
}
.admin-input:focus { border-color: var(--accent); }
.sheet__note { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
.admin-badge {
  display: none; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(255,90,122,.14); padding: 4px 9px; border-radius: 100px;
}
body.is-admin .admin-badge { display: inline-flex; }

/* City sheet */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 14px 20px calc(24px + var(--safe-b));
  animation: rise .25s ease;
  display: flex; flex-direction: column; max-height: 85vh;
}
.sheet__panel > * { flex: 0 0 auto; }
@keyframes rise { from { transform: translateY(100%);} to { transform: translateY(0);} }
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: #3a3a44; margin: 0 auto 14px; }
.sheet__panel h3 { font-size: 17px; margin-bottom: 14px; }
.sheet__opts {
  display: flex; flex-direction: column; gap: 4px;
  flex: 0 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.sheet__opt {
  text-align: left; background: none; border: none; color: var(--text);
  font-size: 15px; font-weight: 500; padding: 13px 8px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.sheet__opt.is-active { color: var(--accent); font-weight: 700; }
.sheet__opt:active { background: var(--surface-2); }
.sheet__opt-meta { font-size: 12px; font-weight: 700; color: var(--accent); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 28px + var(--safe-b));
  transform: translate(-50%, 20px);
  background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 100px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 70;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* PWA install banner — floats just above the bottom nav */
.installbar {
  position: fixed; z-index: 75;
  left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + var(--safe-b));
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid #2c2c36; border-radius: 16px;
  padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  max-width: 440px; margin: 0 auto;
}
.installbar[hidden] { display: none; }
.installbar__icon { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; }
.installbar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.installbar__text strong { font-size: 14px; }
.installbar__text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.installbar__btn {
  flex: 0 0 auto; background: var(--accent); color: #fff; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 10px;
}
.installbar__btn:active { transform: scale(.97); }
.installbar__btn[hidden] { display: none; }
.installbar__x {
  flex: 0 0 auto; background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 6px; line-height: 1;
}

@media (min-width: 481px) {
  .app { border-left: 1px solid #222; border-right: 1px solid #222; }
}
