﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --red: #e60023;
  --red-dark: #ad081b;
  --black: #111;
  --gray1: #333;
  --gray2: #767676;
  --gray3: #efefef;
  --gray4: #f0f0f0;
  --white: #fff;
  --border: #cdcdcd;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r-btn: 24px;
  --r-inp: 16px;
  --r-card: 32px;
}
html, body { height: 100%; font-family: var(--font); background: var(--white); color: var(--black); -webkit-font-smoothing: antialiased; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   AUTH WRAPPER
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#authWrap {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* â”€â”€ MASONRY BG â”€â”€ */
#loginBg {
  position: absolute; inset: 0;
  display: flex; gap: 8px; padding: 0 4px;
  pointer-events: none;
}
.bg-col {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  will-change: transform;
}
.bg-col img { width: 100%; border-radius: 16px; display: block; object-fit: cover; }
.bg-col:nth-child(odd)  { animation: bgUp   var(--spd, 25s) linear infinite; }
.bg-col:nth-child(even) { animation: bgDown var(--spd, 30s) linear infinite; }
.bg-col:nth-child(1) { --spd: 22s; }
.bg-col:nth-child(2) { --spd: 28s; }
.bg-col:nth-child(3) { --spd: 24s; }
.bg-col:nth-child(4) { --spd: 32s; }
.bg-col:nth-child(5) { --spd: 20s; }
.bg-col:nth-child(6) { --spd: 26s; }
.bg-col:nth-child(7) { --spd: 30s; }
@keyframes bgUp   { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
@keyframes bgDown { 0% { transform: translateY(-50%); } 100% { transform: translateY(0); } }

/* gradient overlay */
#loginOverlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.92) 0%,
    rgba(255,255,255,.85) 50%,
    rgba(255,255,255,.92) 100%);
}

/* â”€â”€ SCREENS CONTAINER â”€â”€ */
#screensWrap {
  position: relative; z-index: 2;
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

/* â”€â”€ AUTH SCREEN (ogni schermata auth Ã¨ un .auth-screen) â”€â”€ */
.auth-screen {
  position: absolute;
  width: 100%; max-width: 820px;
  opacity: 0; pointer-events: none;
  transform: translateX(60px) scale(.98);
  transition: opacity .3s ease, transform .3s ease;
}
.auth-screen.active {
  opacity: 1; pointer-events: all;
  transform: translateX(0) scale(1);
}
.auth-screen.exit-left {
  opacity: 0; pointer-events: none;
  transform: translateX(-60px) scale(.98);
  transition: opacity .3s ease, transform .3s ease;
}

/* â”€â”€ AUTH CARD â”€â”€ */
.auth-card {
  background: var(--white); border-radius: var(--r-card);
  box-shadow: 0 4px 32px rgba(0,0,0,.2);
  display: flex; overflow: hidden;
}
/* single-col card (forgot, sent, ecc) */
.auth-card.single {
  max-width: 400px; margin: 0 auto;
  flex-direction: column; align-items: stretch;
}
.auth-card-left  { flex: 1; padding: 48px 48px 40px; }
.auth-card-right {
  flex: 0 0 290px; padding: 48px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-left: 1px solid #e0e0e0; text-align: center;
}
.auth-card.single .auth-card-left { padding: 48px 48px 40px; }

/* â”€â”€ LOGO â”€â”€ */
.p-logo { display: block; margin-bottom: 20px; }
.p-logo svg { display: block; }

/* â”€â”€ TITLES â”€â”€ */
.auth-title { font-size: 26px; font-weight: 700; line-height: 1.25; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--gray2); margin-bottom: 20px; line-height: 1.4; }

/* â”€â”€ INPUTS â”€â”€ */
.inp-wrap { position: relative; margin-bottom: 10px; }
.auth-inp {
  width: 100%; height: 56px; padding: 0 50px 0 16px;
  border: 2px solid var(--border); border-radius: var(--r-inp);
  font-size: 16px; font-family: var(--font); background: var(--white);
  outline: none; transition: border-color .15s;
  color: var(--black);
}
.auth-inp::placeholder { color: #aaa; }
.auth-inp:focus { border-color: var(--black); }
.auth-inp.error { border-color: var(--red); }
.inp-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--gray2);
  display: flex; align-items: center; justify-content: center; padding: 4px;
}

/* nome row */
.name-row { display: flex; gap: 8px; }
.name-row .inp-wrap { flex: 1; }

/* â”€â”€ LINKS â”€â”€ */
.auth-link {
  display: block; font-size: 14px; font-weight: 600; color: var(--black);
  text-decoration: none; margin-bottom: 14px; cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }
.auth-link-red { color: var(--red); }

/* â”€â”€ ERROR MSG â”€â”€ */
.auth-err {
  font-size: 13px; color: var(--red); margin-bottom: 10px; display: none; line-height: 1.4;
}

/* â”€â”€ BUTTONS â”€â”€ */
.btn-auth {
  width: 100%; height: 56px; border-radius: var(--r-btn); border: none;
  font-size: 16px; font-weight: 700; cursor: pointer; font-family: var(--font);
  transition: background .15s, transform .1s;
}
.btn-auth:active { transform: scale(.98); }
.btn-primary { background: #adadad; color: var(--white); }
.btn-primary.ready { background: var(--red); }
.btn-primary.ready:hover { background: var(--red-dark); }
.btn-primary.always-red { background: var(--red); }
.btn-primary.always-red:hover { background: var(--red-dark); }
.btn-secondary {
  width: 100%; height: 56px; border-radius: var(--r-btn);
  border: 2px solid var(--border); background: var(--white);
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--gray4); }
.btn-back {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; font-size: 14px;
  font-weight: 600; color: var(--black); font-family: var(--font);
  margin-bottom: 20px; padding: 0;
}
.btn-back:hover { text-decoration: underline; }

/* â”€â”€ SEPARATOR â”€â”€ */
.sep {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--gray2); margin: 12px 0;
}
.sep::before, .sep::after { content:''; flex:1; height:1px; background:#e0e0e0; }

/* â”€â”€ FOOTER LINK â”€â”€ */
.auth-footer-txt {
  font-size: 14px; color: var(--black); text-align: center; margin-top: 18px; line-height: 1.5;
}
.auth-footer-txt a { font-weight: 700; color: var(--black); text-decoration: none; cursor: pointer; }
.auth-footer-txt a:hover { text-decoration: underline; }

/* â”€â”€ QR SECTION â”€â”€ */
.qr-title { font-size: 15px; font-weight: 400; line-height: 1.5; margin-bottom: 20px; color: var(--black); }
.qr-title strong { font-weight: 700; }
.qr-box {
  width: 180px; height: 180px; border: 1px solid #e0e0e0; border-radius: 16px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.qr-box svg { width: 100%; height: 100%; }

/* â”€â”€ ICON SCREENS (sent, success) â”€â”€ */
.screen-icon { font-size: 72px; margin-bottom: 20px; text-align: center; display: block; }
.screen-icon.animated { animation: iconPop .4s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes iconPop { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }

/* â”€â”€ BOTTOM FOOTER â”€â”€ */
#authFooter {
  position: relative; z-index: 2;
  text-align: center; padding: 12px 16px;
  font-size: 12px; color: var(--gray2);
}
#authFooter a { color: var(--gray2); text-decoration: none; }
#authFooter a:hover { text-decoration: underline; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MAIN APP
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#mainApp { display: none; }

/* â”€â”€ NAVBAR â”€â”€ */
.navbar {
  position: sticky; top: 0; z-index: 50;
  height: 64px; background: var(--white);
  display: flex; align-items: center; padding: 0 16px; gap: 8px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.nav-logo { color: var(--red); display: flex; text-decoration: none; flex-shrink: 0; }
.nav-logo svg { width: 32px; height: 32px; }
.nav-pill {
  height: 48px; padding: 0 20px; border-radius: var(--r-btn); border: none;
  font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s; background: none; color: var(--gray2); font-family: var(--font);
}
.nav-pill:hover { background: var(--gray3); color: var(--black); }
.nav-pill.active { background: var(--black); color: var(--white); }
.nav-search { flex: 1; max-width: 540px; position: relative; }
.nav-search input {
  width: 100%; height: 48px; padding: 0 20px 0 44px;
  border-radius: var(--r-btn); border: none; background: var(--gray3);
  font-size: 16px; outline: none; font-family: var(--font);
}
.nav-search input:focus { background: #e1e1e1; }
.nav-search input::placeholder { color: var(--gray2); }
.nav-search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--black);
}
.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; color: var(--black); font-size: 20px; flex-shrink: 0;
}
.nav-btn:hover { background: var(--gray3); }
.nav-av {
  width: 44px; height: 44px; border-radius: 50%; background: var(--red);
  color: #fff; font-size: 16px; font-weight: 700; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; outline: 3px solid transparent;
  transition: outline .1s; overflow: hidden; flex-shrink: 0;
}
.nav-av:hover { outline-color: var(--black); }
.nav-av img { width: 100%; height: 100%; object-fit: cover; }

/* dropdown */
.dd {
  position: absolute; right: 0; top: 52px; background: var(--white);
  border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.18);
  padding: 8px; min-width: 220px; display: none; z-index: 200;
}
.dd.open { display: block; }
.dd button {
  width: 100%; text-align: left; padding: 12px 16px; border: none; background: none;
  font-size: 15px; cursor: pointer; border-radius: 10px; font-family: var(--font);
}
.dd button:hover { background: var(--gray3); }
.dd hr { border: none; border-top: 1px solid #e0e0e0; margin: 4px 0; }

/* â”€â”€ MASONRY FEED â”€â”€ */
.feed { padding: 16px 8px; }
.masonry { columns: auto; column-width: 236px; column-gap: 8px; }
.pin-card {
  break-inside: avoid; margin-bottom: 8px; border-radius: 16px;
  overflow: hidden; cursor: pointer; position: relative; background: var(--gray3);
  display: block;
}
.pin-card img { width: 100%; display: block; border-radius: 16px; min-height: 60px; }
.pin-hover {
  position: absolute; inset: 0; border-radius: 16px;
  opacity: 0; transition: opacity .15s;
}
.pin-card:hover .pin-hover { opacity: 1; }
.ph-top {
  position: absolute; top: 10px; right: 10px; left: 10px;
  display: flex; justify-content: flex-end; align-items: flex-start; gap: 6px;
}
.ph-bot {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.ph-board {
  background: var(--gray4); color: var(--black); border: none; padding: 10px 16px;
  border-radius: var(--r-btn); font-size: 14px; font-weight: 700; cursor: pointer;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ph-board:hover { background: #ddd; }
.ph-save { background: var(--red); color: #fff; border: none; padding: 10px 18px; border-radius: var(--r-btn); font-size: 15px; font-weight: 700; cursor: pointer; }
.ph-save:hover { background: var(--red-dark); }
.ph-more {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gray4);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
}
.ph-more:hover { background: #ddd; }
.ph-title { color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.5); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-user { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.88); border-radius: 50px; padding: 4px 10px 4px 4px; }
.ph-av { width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.ph-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ph-name { font-size: 12px; font-weight: 600; color: var(--black); }

/* â”€â”€ PIN DETAIL MODAL â”€â”€ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.pin-modal {
  background: var(--white); border-radius: 32px; display: flex;
  max-width: 900px; width: 100%; max-height: 90vh; overflow: hidden;
  position: relative; transform: translateY(20px); transition: transform .25s;
}
.modal-bg.open .pin-modal { transform: none; }
.pm-img { flex: 0 0 50%; max-width: 50%; background: var(--gray3); }
.pm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-info { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; }
.pm-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-shrink: 0; }
.pm-save-row { display: flex; gap: 8px; }
.pm-btn-board { background: var(--gray4); color: var(--black); border: none; padding: 10px 14px; border-radius: var(--r-btn); font-size: 14px; font-weight: 700; cursor: pointer; }
.pm-btn-board:hover { background: #ddd; }
.pm-btn-save { background: var(--red); color: #fff; border: none; padding: 10px 20px; border-radius: var(--r-btn); font-size: 14px; font-weight: 700; cursor: pointer; }
.pm-btn-save:hover { background: var(--red-dark); }
.pm-link { font-size: 13px; color: var(--gray2); word-break: break-all; display: block; margin-bottom: 12px; text-decoration: none; }
.pm-link:hover { text-decoration: underline; }
.pm-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.pm-desc { font-size: 15px; color: var(--gray2); margin-bottom: 20px; }
.pm-author { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 16px; }
.pm-av { width: 48px; height: 48px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.pm-av img { width: 100%; height: 100%; object-fit: cover; }
.pm-author-name { font-weight: 700; font-size: 15px; }
.pm-author-follow { font-size: 14px; color: var(--gray2); }
.modal-x { position: absolute; top: 16px; left: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: none; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 8px rgba(0,0,0,.15); z-index: 10; }

/* â”€â”€ GENERIC MODAL â”€â”€ */
.gmodal {
  background: var(--white); border-radius: 24px;
  width: 420px; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform .25s;
}
.modal-bg.open .gmodal { transform: none; }
.gm-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e0e0e0; font-size: 18px; font-weight: 700; }
.gm-body { padding: 24px; }
.gm-field { margin-bottom: 16px; }
.gm-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.gm-inp { width: 100%; height: 56px; padding: 0 16px; border: 2px solid #e0e0e0; border-radius: var(--r-inp); font-size: 15px; outline: none; font-family: var(--font); }
.gm-inp:focus { border-color: var(--black); }
.gm-ta { width: 100%; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: var(--r-inp); font-size: 15px; outline: none; font-family: var(--font); resize: vertical; min-height: 90px; }
.gm-ta:focus { border-color: var(--black); }
.gm-sel { width: 100%; height: 56px; padding: 0 16px; border: 2px solid #e0e0e0; border-radius: var(--r-inp); font-size: 15px; outline: none; font-family: var(--font); background: var(--white); cursor: pointer; }

/* create pin modal */
.create-wrap { background: var(--white); border-radius: 24px; max-width: 900px; width: 100%; max-height: 90vh; overflow-y: auto; transform: translateY(20px); transition: transform .25s; }
.modal-bg.open .create-wrap { transform: none; }
.create-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid #e0e0e0; font-size: 18px; font-weight: 700; }
.create-body { display: flex; gap: 24px; padding: 24px; }
.create-left { flex: 0 0 340px; }
.create-right { flex: 1; }
.img-drop { width: 100%; aspect-ratio: 2/3; border-radius: 16px; border: 2px dashed var(--border); background: var(--gray4); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; cursor: pointer; position: relative; overflow: hidden; }
.img-drop:hover { border-color: var(--black); }
.img-drop.has { border: none; }
.img-drop img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.img-hint { text-align: center; color: var(--gray2); font-size: 14px; }
.img-hint strong { display: block; color: var(--black); font-size: 16px; margin-bottom: 4px; }
.create-field { margin-bottom: 20px; }
.create-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.create-inp { width: 100%; height: 56px; padding: 0 16px; border: 2px solid #e0e0e0; border-radius: var(--r-inp); font-size: 15px; outline: none; font-family: var(--font); }
.create-inp:focus { border-color: var(--black); }
.create-ta { width: 100%; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: var(--r-inp); font-size: 15px; outline: none; font-family: var(--font); resize: vertical; min-height: 90px; }
.create-ta:focus { border-color: var(--black); }
.create-sel { width: 100%; height: 56px; padding: 0 16px; border: 2px solid #e0e0e0; border-radius: var(--r-inp); font-size: 15px; outline: none; font-family: var(--font); background: var(--white); cursor: pointer; }

/* save modal */
.save-wrap { background: var(--white); border-radius: 24px; width: 380px; max-height: 70vh; overflow-y: auto; transform: translateY(20px); transition: transform .25s; }
.modal-bg.open .save-wrap { transform: none; }
.save-head { padding: 16px 24px; font-size: 18px; font-weight: 700; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; }
.save-list { padding: 8px; }
.save-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.save-item:hover { background: var(--gray3); }
.save-thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--gray3); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.save-thumb img { width: 100%; height: 100%; object-fit: cover; }
.save-name { font-size: 15px; font-weight: 700; }
.save-cnt { font-size: 13px; color: var(--gray2); }

/* â”€â”€ PROFILE â”€â”€ */
.prof-wrap { max-width: 960px; margin: 0 auto; padding: 32px 16px 0; }
.prof-top { display: flex; flex-direction: column; align-items: center; padding-bottom: 24px; }
.prof-av { width: 120px; height: 120px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; margin-bottom: 16px; overflow: hidden; }
.prof-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prof-name { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.prof-handle { font-size: 14px; color: var(--gray2); margin-bottom: 8px; }
.prof-bio { font-size: 14px; color: var(--gray2); max-width: 360px; text-align: center; margin-bottom: 12px; }
.prof-stats { display: flex; gap: 24px; margin-bottom: 20px; }
.prof-stat { text-align: center; cursor: pointer; }
.prof-stat .n { font-size: 16px; font-weight: 700; }
.prof-stat .l { font-size: 14px; color: var(--gray2); }
.prof-stat:hover .l { text-decoration: underline; }
.prof-tabs { display: flex; justify-content: center; border-bottom: 1px solid #e0e0e0; }
.prof-tab { padding: 14px 24px; border: none; background: none; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--gray2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-family: var(--font); }
.prof-tab:hover { color: var(--black); }
.prof-tab.active { color: var(--black); border-bottom-color: var(--black); }

.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; padding: 16px 0; }
.board-card { border-radius: 16px; overflow: hidden; cursor: pointer; }
.board-cover { height: 150px; background: var(--gray3); border-radius: 16px; overflow: hidden; }
.board-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.board-card:hover .board-cover img { transform: scale(1.05); }
.board-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.board-name { font-size: 15px; font-weight: 700; margin-top: 8px; }
.board-cnt { font-size: 13px; color: var(--gray2); }

/* action buttons */
.btn-follow { padding: 10px 24px; border-radius: var(--r-btn); border: none; background: var(--red); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font); }
.btn-follow:hover { background: var(--red-dark); }
.btn-unfollow { background: var(--gray3); color: var(--black); }
.btn-unfollow:hover { background: #ddd; }
.btn-edit { padding: 10px 24px; border-radius: var(--r-btn); border: none; background: var(--gray3); color: var(--black); font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font); }
.btn-edit:hover { background: #ddd; }

/* â”€â”€ TOAST â”€â”€ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--black); color: #fff; padding: 14px 28px; border-radius: 50px; font-size: 15px; font-weight: 600; z-index: 999; transition: transform .3s; white-space: nowrap; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* â”€â”€ UTILS â”€â”€ */
.btn-x { width: 36px; height: 36px; border-radius: 50%; background: var(--gray3); border: none; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.btn-x:hover { background: #ddd; }
.spinner-wrap { display: flex; justify-content: center; padding: 48px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--gray3); border-top-color: var(--red); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 80px 20px; color: var(--gray2); }
.empty-state .ei { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; color: var(--black); margin-bottom: 8px; }
.search-title { font-size: 28px; font-weight: 700; padding: 20px 16px 8px; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MOBILE BOTTOM NAV
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.mobile-nav {
  display:none; position:fixed; bottom:0; left:0; right:0; z-index:60;
  height:56px; background:var(--white); border-top:1px solid rgba(0,0,0,.1);
  justify-content:space-around; align-items:center; padding:0 4px;
  padding-bottom:env(safe-area-inset-bottom);
}
.mnav-btn {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  background:none; border:none; cursor:pointer; font-family:var(--font);
  color:var(--gray2); padding:6px 0; -webkit-tap-highlight-color:transparent;
}
.mnav-btn svg { width:24px; height:24px; }
.mnav-btn span { font-size:10px; font-weight:600; }
.mnav-btn.active { color:var(--black); }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MOBILE / RESPONSIVE
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ TABLET (max 900px) â”€â”€ */
@media(max-width:900px){
  .auth-card-right { display:none; }



  .auth-card { max-width:460px; margin:0 auto; }
  .auth-card-left { padding:40px 36px 32px; }
  .nav-pill { padding:0 12px; font-size:14px; }
  .nav-search input { font-size:15px; }
  .create-body { flex-direction:column; }
  .create-left { flex:none; }
}


/* mobile utility classes */
.m-only{display:none}
.m-auth-header{display:none}
.m-auth-line{display:none}
.m-forgot-header{display:none}
.m-signpost{display:none}
.inp-search-ico{display:none}
.m-fb-notice{font-size:12px;color:#767676;text-align:center;margin-top:16px;line-height:1.5}
.m-fb-notice a{color:#111;font-weight:600;cursor:pointer}
.m-terms{font-size:11px;color:#767676;text-align:center;margin-top:20px;line-height:1.5;padding:0 12px}
.m-terms a{color:#767676;text-decoration:underline;cursor:pointer}
.m-auth-header{align-items:center;justify-content:space-between;padding:12px 16px;background:#fff}
.m-auth-logo{display:flex;align-items:center;gap:4px;font-size:20px;font-weight:700;color:#e60023}
.m-auth-header-btn{background:#e60023;color:#fff;border:none;border-radius:20px;padding:8px 16px;font-size:14px;font-weight:600;cursor:pointer}
.m-auth-line{height:1px;background:#e60023}
.m-forgot-header{align-items:center;padding:12px 16px;background:#fff;gap:12px}
.m-forgot-back{background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center}
.m-forgot-header span{font-size:18px;font-weight:600;flex:1;text-align:center;margin-right:28px}

/* â”€â”€ MOBILE (max 600px) â”€â”€ */
@media(max-width:600px){

  .d-only{display:none!important}
  .m-only{display:block}
  .m-auth-header.active{display:flex}
  .m-auth-line.active{display:block}
  .m-forgot-header.active{display:flex}
  .m-signpost{display:flex;justify-content:center;margin:24px 0 16px}
  .inp-with-search{position:relative}
  .inp-search-ico{display:flex;position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#767676;pointer-events:none;z-index:1}
  .inp-with-search .auth-inp{padding-left:40px}
  .google-wrap{order:-1}
  #loginBg{display:none}
  #loginOverlay{display:none}
  #screensWrap{padding:0;padding-top:0;align-items:stretch}
  .auth-card{box-shadow:none;border-radius:0}
  .auth-card-left{padding:24px 20px 28px;display:flex;flex-direction:column}

  /* masonry bg: reduce columns, lighter for perf */
  #loginBg { gap:4px; }
  .bg-col:nth-child(n+5) { display:none; }
  .bg-col img { border-radius:10px; }

  /* auth card: full width, no border radius */
  #screensWrap { padding:8px; align-items:flex-start; padding-top:40px; }
  .auth-screen { max-width:100%; }
  .auth-card {
    border-radius:24px; max-width:100%;
    box-shadow:0 2px 16px rgba(0,0,0,.15);
  }
  .auth-card.single { max-width:100%; }
  .auth-card-left { padding:32px 24px 28px; }
  .auth-card.single .auth-card-left { padding:32px 24px 28px; }
  .auth-title { font-size:22px; }
  .auth-sub { font-size:13px; margin-bottom:16px; }
  .auth-inp { height:50px; font-size:15px; padding:0 44px 0 14px; }
  .btn-auth { height:50px; font-size:15px; }
  .btn-secondary { height:50px; font-size:14px; }
  .name-row { flex-direction:column; gap:0; }
  .auth-card-right { display:none; }

  /* mobile utility show/hide */
  .d-only{display:none!important}
  .m-only{display:block}
  .m-auth-header.active{display:flex}
  .m-auth-line.active{display:block}
  .m-forgot-header.active{display:flex}
  .m-signpost{display:flex;justify-content:center;margin:24px 0 16px}
  .inp-with-search{position:relative}
  .inp-search-ico{display:flex;position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#767676;pointer-events:none;z-index:1}
  .inp-with-search .auth-inp{padding-left:40px}
  .google-wrap{order:-1}

  /* hide desktop bg on mobile auth */
  #loginBg{display:none}
  #loginOverlay{display:none}
  #screensWrap{padding:0;padding-top:0;align-items:stretch}
  .auth-screen{max-width:100%}
  .auth-card{box-shadow:none;border-radius:0;max-width:100%}
  .auth-card.single{max-width:100%}
  .auth-card-left{padding:24px 20px 28px;display:flex;flex-direction:column}


  /* auth footer */
  #authFooter { font-size:10px; padding:8px 12px; line-height:1.6; }

  /* mobile bottom nav */
  .mobile-nav { display:flex; }
  #mainApp { padding-bottom:60px; }

  /* navbar: compact mobile */
  .navbar { height:56px; padding:0 8px; gap:4px; }
  .nav-logo svg { width:26px; height:26px; }
  .nav-pill { display:none; }
  .nav-search { max-width:none; flex:1; }
  .nav-search input { height:40px; padding:0 14px 0 36px; font-size:14px; border-radius:20px; }
  .nav-search-ico { left:10px; }
  .nav-search-ico svg { width:16px; height:16px; }
  .nav-actions { gap:0; }
  .nav-btn { width:38px; height:38px; }
  .nav-btn svg { width:20px; height:20px; }
  .nav-av { width:38px; height:38px; font-size:14px; }
  .dd { right:-8px; min-width:180px; }

  /* masonry feed: 2 cols */
  .feed { padding:8px 4px; }
  .masonry { columns:2; column-gap:4px; }
  .pin-card { margin-bottom:4px; border-radius:12px; }
  .pin-card img { border-radius:12px; }

  /* pin hover: always show save button on mobile */
  .pin-hover { border-radius:12px; }
  .ph-save { padding:8px 14px; font-size:13px; border-radius:20px; }
  .ph-board { display:none; }
  .ph-title { font-size:12px; }
  .ph-user { padding:3px 8px 3px 3px; }
  .ph-av { width:20px; height:20px; font-size:8px; }
  .ph-name { font-size:11px; }
  .ph-more { width:30px; height:30px; font-size:14px; }

  /* pin modal: full screen sheet */
  .modal-bg { padding:0; align-items:flex-end; }
  .pin-modal {
    flex-direction:column; border-radius:16px 16px 0 0;
    max-height:95vh; width:100%; max-width:100%;
  }
  .pm-img { max-width:100%; flex:none; height:280px; }
  .pm-info { padding:16px; }
  .pm-title { font-size:20px; }
  .pm-desc { font-size:14px; }
  .pm-av { width:40px; height:40px; font-size:16px; }
  .modal-x { top:12px; left:12px; width:36px; height:36px; font-size:16px; }

  /* create pin modal */
  .create-wrap { border-radius:16px 16px 0 0; max-height:95vh; }
  .create-body { flex-direction:column; padding:16px; gap:16px; }
  .create-left { flex:none; }
  .img-drop { aspect-ratio:1/1; }
  .create-head { padding:12px 16px; font-size:16px; }
  .create-inp, .create-ta, .create-sel { font-size:14px; }
  .create-inp { height:48px; }

  /* save modal */
  .save-wrap { width:100%; border-radius:16px 16px 0 0; max-height:70vh; }

  /* generic modal */
  .gmodal { width:100%; border-radius:16px 16px 0 0; }
  .gm-head { padding:16px 20px; font-size:16px; }
  .gm-body { padding:16px 20px; }
  .gm-inp { height:48px; font-size:14px; }

  /* profile */
  .prof-wrap { padding:20px 12px 0; }
  .prof-av { width:80px; height:80px; font-size:32px; }
  .prof-name { font-size:24px; }
  .prof-handle { font-size:13px; }
  .prof-bio { font-size:13px; }
  .prof-stats { gap:16px; }
  .prof-tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .prof-tab { padding:12px 16px; font-size:14px; white-space:nowrap; }
  .boards-grid { grid-template-columns:repeat(2,1fr); gap:8px; }
  .board-cover { height:110px; }

  /* buttons */
  .btn-follow, .btn-unfollow, .btn-edit { padding:8px 20px; font-size:14px; }

  /* search */
  .search-title { font-size:22px; padding:12px 12px 4px; }

  /* toast */
  .toast { font-size:13px; padding:12px 20px; bottom:16px; }
}

/* â”€â”€ SMALL PHONE (max 380px) â”€â”€ */
@media(max-width:380px){
  .auth-card-left { padding:24px 16px 20px; }
  .auth-title { font-size:20px; }
  .auth-inp { height:46px; font-size:14px; }
  .btn-auth { height:46px; font-size:14px; }
  .btn-secondary { height:46px; font-size:13px; }
  .navbar { height:50px; padding:0 6px; }
  .nav-search input { height:36px; font-size:13px; }
  .nav-btn { width:34px; height:34px; }
  .nav-av { width:34px; height:34px; font-size:12px; }
  .prof-av { width:64px; height:64px; font-size:26px; }
  .prof-name { font-size:20px; }

  /* ensure inputs don't zoom on iOS (font â‰¥16px) */
  .auth-inp, .nav-search input, .gm-inp, .create-inp, .create-ta, .create-sel, .gm-ta {
    font-size:16px;
  }
}

/* â”€â”€ TOUCH: disable hover effects on touch devices â”€â”€ */
@media(hover:none){
  .pin-hover { display:none; }
  .pin-card { -webkit-tap-highlight-color:transparent; }
  .ph-save { display:none; }
}
