:root{
  --brand:#4f46e5;
  --brand-dark:#3730a3;
  --purple:#7c3aed;
  --ink:#111827;
  --muted:#6b7280;
  --bg:#f5f6fb;
  --card:#ffffff;
  --ring:#e5e7eb;
  --soft:#eef2ff;
  --gold:#facc15;
}
*{box-sizing:border-box;}
html,body{margin:0;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;}
body{min-width:320px;font-family:Poppins,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink);line-height:1.6;}
a{color:inherit;text-decoration:none;}button,input,textarea,select{font:inherit;}button{cursor:pointer;}.hidden{display:none!important;}
.topbar{position:fixed;top:0;left:0;right:0;width:100%;z-index:1450;background:rgba(255,255,255,.93);backdrop-filter:blur(14px);border-bottom:1px solid var(--ring);}
/* Push content below fixed topbar (height ≈ 55px globally, 53px on mobile) */
body{padding-top:55px;}
.nav{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:14px 20px;}
.brand{display:flex;align-items:center;gap:.75rem;font-weight:900;letter-spacing:-.03em;min-width:0;}
.logo{width:42px;height:42px;flex:0 0 auto;border-radius:14px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,var(--brand),var(--purple));box-shadow:0 12px 24px rgba(79,70,229,.24);font-weight:900;}
.brand small{display:block;color:var(--muted);font-weight:700;font-size:.75rem;letter-spacing:0;}
.nav-actions{display:flex;align-items:center;gap:.5rem;}
.nopi-balance{
  height:38px;
  min-width:64px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:1px solid rgba(250,204,21,.55);
  border-radius:999px;
  padding:0 11px;
  background:linear-gradient(135deg,#fffdf2,#fff7db);
  color:#7c4a00;
  box-shadow:0 8px 18px rgba(250,204,21,.16);
  font-weight:800;
  line-height:1;
  position:relative;
  overflow:visible;
}
/* Nopis earn animation */
@keyframes nopiPop{
  0%{transform:scale(1);}
  30%{transform:scale(1.22);}
  60%{transform:scale(.96);}
  100%{transform:scale(1);}
}
@keyframes nopisFloat{
  0%{opacity:0;transform:translateX(-50%) translateY(26px);}
  18%{opacity:1;transform:translateX(-50%) translateY(14px);}
  72%{opacity:1;transform:translateX(-50%) translateY(2px);}
  100%{opacity:0;transform:translateX(-50%) translateY(-8px);}
}
.nopi-balance.nopi-pop{
  animation:nopiPop .45s cubic-bezier(.34,1.56,.64,1);
}
.nopi-earn-float{
  position:absolute;
  top:calc(100% + 6px);
  left:50%;
  transform:translateX(-50%);
  background:var(--brand);
  color:#fff;
  border-radius:999px;
  padding:3px 10px;
  font-size:.74rem;
  font-weight:800;
  white-space:nowrap;
  pointer-events:none;
  animation:nopisFloat 1.9s ease forwards;
  z-index:100;
  box-shadow:0 4px 12px rgba(79,70,229,.3);
}
.nopi-balance span{
  font-variant-numeric:tabular-nums;
}
.nopi-coin-svg{display:block;flex-shrink:0;filter:drop-shadow(0 1px 2px rgba(0,0,0,.18));}
.ghost-btn,.join-btn,.primary-btn,.secondary-btn{border:0;border-radius:999px;font-weight:900;white-space:nowrap;}
.join-btn,.primary-btn{color:#fff;background:linear-gradient(135deg,var(--brand),var(--purple));box-shadow:0 10px 22px rgba(79,70,229,.2);}
.join-btn{padding:.8rem 1.1rem;}.ghost-btn{padding:.75rem 1rem;background:#fff;color:var(--brand);border:1px solid #ddd6fe;}.primary-btn{padding:.85rem 1rem;border-radius:14px;}.secondary-btn{padding:.8rem 1rem;color:var(--brand-dark);background:#fff;border:1px solid rgba(79,70,229,.18);border-radius:14px;}
.quick-menu-wrap{position:relative;top:auto;z-index:10;background:rgba(245,246,251,.9);backdrop-filter:blur(10px);border-bottom:1px solid rgba(229,231,235,.65);margin-top:10px;}
.quick-menu{max-width:1200px;margin:0 auto;display:flex;gap:.55rem;overflow-x:auto;padding:12px 20px;scrollbar-width:none;}
.quick-menu::-webkit-scrollbar{display:none;}.quick-link{flex:0 0 auto;border:1px solid var(--ring);background:#fff;color:#374151;border-radius:999px;padding:.65rem .9rem;font-weight:900;box-shadow:0 6px 18px rgba(17,24,39,.04);}.quick-link.active{color:#fff;background:linear-gradient(135deg,var(--brand),var(--purple));border-color:transparent;}
.view{width:100%;}.page-intro{max-width:1200px;margin:0 auto;padding:26px 20px 8px;}.page-intro h1,.page-panel h1{margin:0;font-size:clamp(2rem,4vw,3.3rem);line-height:1.06;letter-spacing:-.055em;}.page-intro p{margin:.55rem 0 0;color:var(--muted);font-weight:700;max-width:720px;font-size:1.05rem;}
/* Community page-intro (h1 + description) is redundant and scrolls under the sticky tabs */
#communityView .page-intro{display:none;}
.card{background:var(--card);border:1px solid var(--ring);border-radius:24px;box-shadow:0 12px 28px rgba(17,24,39,.06);}.box{padding:18px;}.box h3{margin:0 0 .8rem;font-size:1.1rem;line-height:1.2;}.muted{color:var(--muted);}.small{font-size:.9rem;}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:14px;}.section-heading h1,.section-heading h2{margin:0;letter-spacing:-.04em;}.section-heading h2{font-size:1.45rem;}.xp-pill{display:inline-flex;align-items:center;justify-content:center;background:#fff7db;color:#8a6100;border:1px solid rgba(250,204,21,.5);border-radius:999px;padding:.35rem .65rem;font-weight:900;font-size:.78rem;white-space:nowrap;}
.missions-wrap{max-width:1200px;margin:0 auto;padding:14px 20px 6px;}.mission-card{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;padding:18px;}.mission-icon{width:58px;height:58px;border-radius:20px;display:grid;place-items:center;background:var(--soft);font-size:1.6rem;}.mission-copy h3{margin:0 0 .2rem;font-size:1.2rem;}.mission-copy p{margin:0;color:var(--muted);font-weight:600;}.mission-reward{margin-top:.45rem;color:var(--brand);font-weight:900;}.mission-card.completed{background:linear-gradient(135deg,#ffffff,#f0fdf4);border-color:#bbf7d0;}.mission-card.completed .mission-btn{background:#16a34a;box-shadow:0 10px 20px rgba(22,163,74,.18);}.mission-btn{min-width:150px;}
.layout{max-width:1200px;margin:0 auto;padding:18px 20px 42px;display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:18px;align-items:start;}.feed{display:grid;gap:14px;min-width:0;}.rightbar{position:sticky;top:138px;display:grid;gap:14px;}.composer{padding:16px;}.composer-top{display:flex;gap:12px;align-items:center;}.avatar{width:46px;height:46px;flex:0 0 auto;border-radius:999px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,var(--brand),var(--purple));font-weight:900;}.title-input{flex:1;min-width:0;}input,textarea,select{width:100%;border:1px solid var(--ring);border-radius:14px;padding:.85rem .95rem;background:#fff;color:var(--ink);}textarea{min-height:110px;resize:vertical;margin-top:12px;}input:focus,textarea:focus,select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 4px rgba(79,70,229,.12);}.form-row{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:10px;align-items:center;}.chips{display:flex;gap:.55rem;overflow-x:auto;padding:0;scrollbar-width:none;}.chips::-webkit-scrollbar{display:none;}.chip{flex:0 0 auto;border:1px solid var(--ring);background:#fff;color:#374151;border-radius:999px;padding:.6rem .85rem;font-weight:900;white-space:nowrap;font-size:.88rem;}.chip.active{color:#fff;background:linear-gradient(135deg,var(--brand),var(--purple));border-color:transparent;}
.post{padding:20px;}.post-head{display:flex;justify-content:space-between;gap:1rem;margin-bottom:12px;}.author{display:flex;align-items:center;gap:.75rem;min-width:0;}.author strong{display:block;line-height:1.2;font-size:1.05rem;}.author span{display:block;color:var(--muted);font-size:.86rem;font-weight:700;}.category{align-self:start;color:var(--brand);background:var(--soft);border:1px solid #e0e7ff;border-radius:999px;padding:.35rem .7rem;font-size:.78rem;font-weight:900;white-space:nowrap;}.post h2{margin:0 0 .5rem;font-size:1.35rem;letter-spacing:-.03em;}.post p{margin:.25rem 0 0;color:#374151;white-space:pre-wrap;font-size:1.02rem;}.post-actions{display:flex;flex-wrap:wrap;gap:.8rem;border-top:1px solid var(--ring);margin-top:14px;padding-top:12px;color:var(--muted);font-weight:900;font-size:.9rem;}.action-btn{border:0;background:transparent;color:var(--muted);font-weight:900;padding:0;}.comments{margin-top:14px;border-top:1px solid var(--ring);padding-top:12px;display:grid;gap:10px;}.comment{padding:10px 12px;border-radius:14px;background:#f9fafb;border:1px solid var(--ring);}.comment-form{display:grid;grid-template-columns:1fr auto;gap:8px;}.comment-form input{border-radius:999px;}
.event,.calendar-item{display:flex;gap:12px;align-items:flex-start;padding:.8rem 0;border-top:1px solid var(--ring);}.event:first-of-type,.calendar-item:first-child{border-top:none;padding-top:0;}.date{width:50px;flex:0 0 auto;border-radius:16px;background:var(--soft);color:var(--brand);text-align:center;padding:.5rem .2rem;font-weight:900;line-height:1.15;}.date small{display:block;font-size:.66rem;}.date.big{width:62px;padding:.65rem .2rem;}.calendar-item h3{margin:.1rem 0 .15rem;}.calendar-list{display:grid;gap:0;}
.page-view{max-width:1200px;margin:0 auto;padding:24px 20px 48px;}.page-panel{padding:22px;}.profile-card{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:center;}.profile-info h2{margin:0;font-size:1.65rem;letter-spacing:-.04em;}.profile-info p{margin:.3rem 0;}.profile-actions{margin-top:1rem;}.leaderboard-grid{display:grid;gap:12px;margin-top:18px;}.leader-row{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;padding:14px;border:1px solid var(--ring);border-radius:22px;background:#fff;}.rank{width:34px;height:34px;border-radius:999px;background:#111827;color:#fff;display:grid;place-items:center;font-weight:900;}.leader-main strong{display:block;font-size:1.05rem;}.leader-main span{color:var(--muted);font-weight:700;font-size:.9rem;}.level-ring{--progress:0%;width:74px;height:74px;border-radius:999px;background:conic-gradient(var(--purple) var(--progress), #e5e7eb 0);display:grid;place-items:center;box-shadow:inset 0 0 0 1px rgba(124,58,237,.12);}.level-inner{width:56px;height:56px;border-radius:999px;background:#fff;display:grid;place-items:center;text-align:center;font-weight:900;color:var(--brand-dark);line-height:1;}.level-inner small{display:block;font-size:.58rem;color:var(--muted);letter-spacing:.02em;}.profile-level{width:110px;height:110px;}.profile-level .level-inner{width:84px;height:84px;font-size:1.4rem;}
.auth-modal{position:fixed;top:55px;left:0;right:0;bottom:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(17,24,39,.58);}.auth-modal.hidden{display:none!important;}.auth-dialog{position:relative;width:min(100%,440px);max-height:88dvh;overflow:auto;background:#fff;border:1px solid var(--ring);border-radius:24px;box-shadow:0 28px 80px rgba(17,24,39,.28);padding:22px;}.auth-close{position:absolute;top:12px;right:12px;width:38px;height:38px;border:0;border-radius:999px;background:#f3f4f6;color:#111827;font-weight:900;font-size:1.1rem;}.auth-view h2{margin:0 34px .35rem 0;font-size:1.55rem;line-height:1.15;letter-spacing:-.03em;}.auth-form{display:grid;gap:10px;}.auth-switch{margin-top:14px;padding-top:14px;border-top:1px solid var(--ring);text-align:center;}.auth-switch p{margin:0 0 .65rem;color:var(--muted);font-weight:700;}.auth-switch button{width:100%;}.message{min-height:1.4em;margin:.75rem 0 0;color:#b91c1c;font-weight:800;font-size:.9rem;}body.modal-open{overflow:hidden;}
@media (max-width:900px){.layout{grid-template-columns:1fr;}.rightbar{position:static;}.mission-card{grid-template-columns:auto 1fr;}.mission-btn{grid-column:1 / -1;width:100%;}.profile-card{grid-template-columns:1fr;text-align:center;}.profile-level{margin:0 auto;}}
@media (max-width:760px){.nav{padding:12px 14px;}.logo{width:42px;height:42px;border-radius:14px;}.brand{gap:.65rem;}.brand span:last-child{font-size:1rem;line-height:1.15;}.brand small{font-size:.72rem;}.join-btn,.ghost-btn{padding:.78rem .95rem;font-size:.9rem;}.quick-menu-wrap{top:67px;}.quick-menu{padding:10px 14px;}.quick-link{padding:.6rem .85rem;font-size:.88rem;}.page-intro{padding:22px 18px 8px;}.page-intro h1,.page-panel h1{font-size:2rem;}.page-intro p{font-size:.98rem;}.missions-wrap,.layout,.page-view{padding-left:12px;padding-right:12px;}.layout{padding-top:12px;gap:12px;}.card{border-radius:22px;}.post,.box,.composer,.page-panel{padding:16px;}.category-card{padding:14px 0 14px 14px;}.form-row,.comment-form{grid-template-columns:1fr;}.post-head{display:block;}.category{display:inline-flex;margin-top:12px;}.leader-row{grid-template-columns:auto 1fr;}.leader-row .level-ring{grid-column:1 / -1;margin-left:auto;margin-right:auto;}.auth-dialog{width:min(100%,360px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:20px;padding:18px;}.section-heading{align-items:flex-start;}.chips{padding-right:14px;}}

/* Mission auto-complete update */
.mission-status{
  justify-self:end;
  color:var(--brand);
  background:var(--soft);
  border:1px solid #e0e7ff;
  border-radius:999px;
  padding:.7rem .9rem;
  font-weight:900;
  white-space:nowrap;
}
.mission-card.completed .mission-status{
  color:#047857;
  background:#dcfce7;
  border-color:#bbf7d0;
}
.mission-toast{
  position:fixed;
  left:50%;
  bottom:calc(24px + env(safe-area-inset-bottom));
  z-index:1400;
  transform:translate(-50%, 18px);
  opacity:0;
  width:min(calc(100vw - 28px), 420px);
  background:#111827;
  color:#fff;
  border-radius:22px;
  padding:16px 18px;
  box-shadow:0 22px 60px rgba(17,24,39,.28);
  transition:opacity .35s ease, transform .35s ease;
  pointer-events:none;
}
.mission-toast.show{
  opacity:1;
  transform:translate(-50%, 0);
}
.mission-toast strong{display:block;font-size:1rem;}
.mission-toast span{display:block;color:#d1d5db;font-weight:700;font-size:.9rem;margin-top:.15rem;}

/* Simple leaderboard list */
.leaderboard-list{display:grid;gap:10px;margin-top:18px;}
.leader-line{
  display:grid;
  grid-template-columns:42px minmax(0, 1fr) auto auto;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--ring);
  border-radius:18px;
  background:#fff;
}
.leader-name{font-weight:900;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.leader-xp,.leader-level{font-weight:900;color:var(--muted);white-space:nowrap;font-size:.92rem;}
.leader-level{color:var(--brand);background:var(--soft);border-radius:999px;padding:.32rem .58rem;}

@media (max-width:900px){
  .mission-card{grid-template-columns:auto 1fr;}
  .mission-status{grid-column:1 / -1;justify-self:stretch;text-align:center;white-space:normal;}
}
@media (max-width:760px){
  .leader-line{grid-template-columns:34px minmax(0, 1fr) auto;gap:9px;padding:11px 12px;}
  .leader-xp{font-size:.84rem;}
  .leader-level{grid-column:2 / -1;justify-self:start;font-size:.8rem;margin-top:-3px;}
  .mission-toast{bottom:calc(18px + env(safe-area-inset-bottom));border-radius:18px;}
}

/* Compact UI + stronger mobile containment */
:root{
  --compact-shadow:0 8px 18px rgba(17,24,39,.045);
}
body{font-size:14.5px;line-height:1.5;overflow-x:hidden;}
body, .view, main, section, article, aside, div{max-width:100%;}
.nav,.quick-menu,.page-intro,.missions-wrap,.layout,.page-view{max-width:1040px;}
.nav{padding:10px 16px;}
.logo{width:34px;height:34px;border-radius:11px;font-size:.95rem;}
.brand{gap:.55rem;font-size:.98rem;}
.brand small{font-size:.68rem;}
.join-btn{padding:.62rem .9rem;font-size:.86rem;}
.ghost-btn{padding:.58rem .85rem;font-size:.86rem;}
.quick-menu-wrap{top:auto;}
.quick-menu{padding:8px 16px;gap:.45rem;}
.quick-link,.chip{padding:.48rem .68rem;font-size:.8rem;}
.page-intro{padding:18px 16px 6px;}
.page-intro h1,.page-panel h1{font-size:clamp(1.6rem,3vw,2.35rem);letter-spacing:-.04em;}
.page-intro p{font-size:.92rem;max-width:620px;}
.card{border-radius:18px;box-shadow:var(--compact-shadow);}
.box,.composer,.post,.page-panel{padding:13px;}
.box h3{font-size:.98rem;margin-bottom:.55rem;}
.small{font-size:.8rem;}
.missions-wrap{padding:10px 16px 4px;}
.mission-card{padding:13px;gap:11px;}
.mission-icon{width:42px;height:42px;border-radius:14px;font-size:1.2rem;}
.mission-copy h3{font-size:1rem;}
.mission-copy p,.mission-reward{font-size:.82rem;}
.mission-status{padding:.52rem .72rem;font-size:.82rem;}
.layout{padding:12px 16px 30px;grid-template-columns:minmax(0,1fr) 250px;gap:12px;}
.rightbar{top:110px;gap:10px;}
.feed{gap:10px;}
.composer-top{gap:9px;}
.avatar{width:36px;height:36px;font-size:.92rem;}
input,textarea,select{border-radius:11px;padding:.65rem .75rem;font-size:.88rem;}
textarea{min-height:82px;margin-top:9px;}
.form-row{gap:8px;margin-top:8px;}
.primary-btn,.secondary-btn{padding:.66rem .8rem;font-size:.86rem;border-radius:11px;}
.feed-date-divider{display:flex;align-items:center;gap:10px;padding:10px 0 2px;color:var(--muted,#999);font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;}.feed-date-divider::before,.feed-date-divider::after{content:'';flex:1;height:1px;background:var(--border,#ececec);}
.post-head{margin-bottom:9px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}.post-head .author{flex:1 1 auto;min-width:0;}.post-head .post-badges{flex:0 0 auto;max-width:45%;}
.author{gap:.58rem;}
.author strong{font-size:.94rem;}
.author span{font-size:.76rem;}
.category{padding:.28rem .55rem;font-size:.7rem;}
.post h2{font-size:1.08rem;margin-bottom:.35rem;}
.post p,.comment,.comment p{
  font-size:.91rem;
  line-height:1.5;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:pre-wrap;
  max-width:100%;
}
.post-actions{gap:.62rem;margin-top:10px;padding-top:9px;font-size:.8rem;}
.comments{margin-top:10px;padding-top:9px;gap:8px;}
.comment{padding:8px 10px;border-radius:12px;}
.event,.calendar-item{padding:.62rem 0;gap:9px;}
.date{width:42px;border-radius:13px;padding:.42rem .15rem;font-size:.86rem;}
.date small{font-size:.58rem;}
.page-view{padding:18px 16px 34px;}
.profile-info h2{font-size:1.25rem;}
.leaderboard-list{gap:8px;margin-top:12px;}
.leader-line{grid-template-columns:34px minmax(0,1fr) auto auto;gap:9px;padding:10px 11px;border-radius:15px;}
.rank{width:28px;height:28px;font-size:.78rem;}
.leader-name{font-size:.9rem;}
.leader-xp,.leader-level{font-size:.78rem;}
.auth-dialog{width:min(100%,390px);padding:17px;border-radius:19px;}
.auth-view h2{font-size:1.22rem;}
.message{font-size:.78rem;}

/* keep all user-generated text inside cards */
.post,.comment,.card,.feed,.layout,.rightbar,.box{min-width:0;overflow-wrap:anywhere;}
.post *,.comment *,.box *{min-width:0;}

@media (max-width:760px){
  body{font-size:13.5px;line-height:1.45;padding-top:53px;}
  .nav{padding:9px 12px;gap:.6rem;}
  .brand span:last-child{font-size:.92rem;}
  .brand small{font-size:.64rem;}
  .logo{width:34px;height:34px;border-radius:11px;}
  .join-btn,.ghost-btn{padding:.58rem .78rem;font-size:.8rem;}
  .nopi-balance{height:34px;min-width:54px;padding:0 9px;font-size:.82rem;}
  .quick-menu-wrap{top:auto;}
  .quick-menu{padding:8px 12px;gap:.4rem;}
  .quick-link{padding:.46rem .62rem;font-size:.78rem;}
  .page-intro{padding:16px 13px 5px;}
  .page-intro h1,.page-panel h1{font-size:1.65rem;}
  .page-intro p{font-size:.88rem;line-height:1.45;}
  .missions-wrap,.layout,.page-view{padding-left:10px;padding-right:10px;}
  .layout{padding-top:10px;gap:10px;}
  .card{border-radius:16px;}
  .box,.composer,.post,.page-panel{padding:12px;}
  .mission-card{padding:12px;gap:9px;}
  .mission-icon{width:38px;height:38px;border-radius:12px;font-size:1.05rem;}
  .mission-copy h3{font-size:.93rem;}
  .mission-copy p,.mission-reward{font-size:.78rem;}
  .mission-status{padding:.48rem .62rem;font-size:.78rem;}
  .avatar{width:34px;height:34px;}
  .author strong{font-size:.9rem;}
  .author span{font-size:.72rem;line-height:1.3;}
  .category{margin-top:9px;font-size:.68rem;}
  .post h2{font-size:1rem;line-height:1.25;}
  .post p,.comment,.comment p{font-size:.86rem;line-height:1.45;}
  .post-actions{font-size:.76rem;}
  .chips{gap:.38rem;}
  .chip{padding:.45rem .6rem;font-size:.76rem;}
  .form-row,.comment-form{gap:7px;}
  input,textarea,select{font-size:.84rem;padding:.6rem .68rem;}
  textarea{min-height:76px;}
  .rightbar{gap:10px;}
  .event strong,.calendar-item strong{font-size:.88rem;}
  .leader-line{grid-template-columns:30px minmax(0,1fr) auto;gap:7px;padding:9px 10px;border-radius:14px;}
  .rank{width:25px;height:25px;font-size:.7rem;}
  .leader-name{font-size:.84rem;}
  .leader-xp{font-size:.74rem;}
  .leader-level{font-size:.72rem;padding:.25rem .48rem;}
  .auth-modal{top:53px;}
  .subscription-modal{top:53px;}
  .subscription-dialog{max-height:calc(100dvh - 53px - 20px);}
  .auth-dialog{max-width:calc(100vw - 20px);padding:15px;border-radius:18px;}
  .auth-close{width:32px;height:32px;top:10px;right:10px;}
  .auth-view h2{font-size:1.1rem;margin-right:34px;}
}

/* Final layout correction: compact one-column community feed */
.stats-top-wrap{
  max-width:1040px;
  margin:0 auto;
  padding:8px 16px 4px;
}
.stats-card{
  padding:12px 14px;
}
.stats-card h3{
  margin:0 0 .25rem;
  font-size:.95rem;
  line-height:1.2;
}
.stats-card p{
  margin:0;
}
#community.layout,
.layout{
  display:block !important;
  max-width:1040px !important;
  padding:10px 16px 30px !important;
}
.feed{
  width:100%;
  min-width:0;
}
.rightbar{display:none !important;}
.composer form,
.post,
.post *{
  min-width:0;
  max-width:100%;
}
.post p,
.comment p,
.post h2,
.author span,
.author strong{
  overflow-wrap:anywhere;
  word-break:normal;
  white-space:normal;
}
.author > div:last-child{
  min-width:0;
}
.category-card{
  overflow:hidden;
}
.chips{
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Desktop category strip: show overflow and allow mouse-driven horizontal travel. */
.category-card{
  position:relative;
  padding-right:0;
}
.category-card::after{
  content:'';
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  width:44px;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.94));
  border-radius:0 22px 22px 0;
}
.chips{
  cursor:grab;
  overscroll-behavior-inline:contain;
  padding-bottom:7px;
  scroll-behavior:smooth;
  scrollbar-width:thin;
  scrollbar-color:rgba(99,102,241,.52) transparent;
}
.chips.is-dragging{
  cursor:grabbing;
  scroll-behavior:auto;
  user-select:none;
}
.chips::-webkit-scrollbar{
  display:block;
  height:8px;
}
.chips::-webkit-scrollbar-track{
  background:transparent;
}
.chips::-webkit-scrollbar-thumb{
  background:rgba(99,102,241,.45);
  border:2px solid transparent;
  border-radius:999px;
  background-clip:content-box;
}
@media (max-width:760px){
  .category-card::after{display:none;}
  .chips{
    cursor:auto;
    padding-bottom:0;
    scrollbar-width:none;
  }
  .chips::-webkit-scrollbar{display:none;}
}

/* Real calendar page */
.calendar-shell{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.calendar-month{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
}
.calendar-month h2{
  margin:0;
  font-size:1.15rem;
  letter-spacing:-.03em;
}
.calendar-month p{margin:0;}
.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:6px;
  width:100%;
}
.weekday{
  text-align:center;
  color:var(--muted);
  font-size:.72rem;
  font-weight:900;
  padding:3px 0;
}
.day{
  min-height:64px;
  border:1px solid var(--ring);
  border-radius:14px;
  background:#fff;
  padding:8px;
  font-weight:900;
  font-size:.82rem;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
}
.day small{
  display:block;
  color:var(--muted);
  font-size:.62rem;
  font-weight:800;
  line-height:1.1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.day.muted-day{
  background:#f8fafc;
  border-color:#eef2f7;
}
.day.today{
  border-color:#c4b5fd;
  background:#f5f3ff;
  color:var(--brand-dark);
}
.day.has-event{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  box-shadow:0 8px 18px rgba(79,70,229,.18);
}
.day.has-event small{color:#ede9fe;}
.calendar-events{
  margin-top:14px;
  display:grid;
  gap:8px;
}
.compact-event{
  background:#fff;
  border:1px solid var(--ring);
  border-radius:16px;
  padding:10px 12px;
}
.compact-event h3{
  margin:0 0 .15rem;
  font-size:.95rem;
}
.compact-event p{margin:0;}

@media (max-width:760px){
  html,body{
    width:100%;
    overflow-x:hidden !important;
  }
  .stats-top-wrap{
    padding:7px 10px 3px;
  }
  .stats-card{
    padding:11px 12px;
    border-radius:16px;
  }
  .stats-card h3{
    font-size:.9rem;
  }
  #community.layout,
  .layout{
    padding:8px 10px 28px !important;
    width:100% !important;
    overflow:hidden;
  }
  .composer-top{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
  }
  .composer-top .primary-btn{
    grid-column:1 / -1;
  }
  .title-input{
    width:100%;
  }
  .post-head{
    display:flex !important;
    align-items:flex-start;
    justify-content:space-between;
    gap:8px;
  }
  .author{
    min-width:0;
    flex:1 1 auto;
  }
  .author span{
    font-size:.68rem;
  }
  .category{
    margin-top:0 !important;
    flex:0 0 auto;
    max-width:42%;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .post h2{
    font-size:.98rem;
  }
  .post p,
  .comment p{
    font-size:.84rem;
    line-height:1.4;
  }
  .calendar-grid{
    gap:4px;
  }
  .weekday{
    font-size:.62rem;
  }
  .day{
    min-height:48px;
    border-radius:10px;
    padding:5px;
    font-size:.72rem;
  }
  .day small{
    font-size:.5rem;
  }
  .calendar-month h2{
    font-size:1rem;
  }
}


/* --- Post + comments upgrade --- */
.composer{padding:10px!important;}
.composer-trigger{width:100%;display:flex;align-items:center;gap:10px;border:0;background:#fff;text-align:left;cursor:pointer;padding:4px;border-radius:18px;}
.composer-trigger span{flex:1;border:1px solid var(--ring);background:#f9fafb;color:#8b93a1;border-radius:999px;padding:.72rem .95rem;font-weight:800;}
.expanded-composer{display:grid;gap:10px;}
.expanded-composer.hidden{display:none!important;}
.expanded-composer textarea{margin-top:0;min-height:96px;}
.expanded-composer .image-preview-slot:empty,
.expanded-composer .voice-preview-slot:empty,
.expanded-composer .voice-record-status:empty{display:none;}
.composer-actions{display:flex;gap:8px;justify-content:flex-end;}
.icon-actions{display:flex!important;align-items:center;gap:14px!important;}
.icon-action{border:0;background:transparent;color:#687080;font-weight:900;padding:6px 8px;border-radius:999px;display:inline-flex;align-items:center;gap:5px;cursor:pointer;font-size:1.05rem;line-height:1;transition:transform .18s ease, background .18s ease;}
.icon-action:hover{background:#f3f4f6;transform:translateY(-1px);}
.icon-action.static{cursor:default;}
.icon-count{font-size:.86rem;color:#6b7280;font-weight:900;}
.heart-icon{display:inline-block;font-size:1.25rem;transform-origin:center;}
.heart-burst .heart-icon{animation:heartPop .6s cubic-bezier(.2,.8,.2,1);}
@keyframes heartPop{0%{transform:scale(1);}35%{transform:scale(1.75) rotate(-10deg);}60%{transform:scale(.9) rotate(6deg);}100%{transform:scale(1);}}
.post-detail-modal{position:fixed;top:55px;left:0;right:0;bottom:0;z-index:1400;background:#f5f6fb;display:block;overflow:hidden;}
.post-detail-modal.hidden{display:none!important;}
.post-detail-shell{height:calc(100dvh - 55px);overflow-y:auto;-webkit-overflow-scrolling:touch;max-width:820px;margin:0 auto;background:#fff;box-shadow:0 0 0 1px var(--ring);}
.detail-topbar{position:sticky;top:0;z-index:2;height:58px;display:flex;align-items:center;gap:12px;padding:0 16px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border-bottom:1px solid var(--ring);}
@media (max-width:760px){
  .post-detail-modal{top:53px;}
  .post-detail-shell{height:calc(100dvh - 53px);}
}
.detail-close{width:38px;height:38px;border:0;border-radius:999px;background:#f3f4f6;font-size:1.35rem;font-weight:900;cursor:pointer;}
.detail-post-card{padding:18px 18px 14px;border-bottom:8px solid #f3f4f6;}
.detail-post-card h1{margin:.7rem 0 .55rem;font-size:1.55rem;line-height:1.18;letter-spacing:-.03em;overflow-wrap:anywhere;}
.detail-post-card p{white-space:pre-wrap;overflow-wrap:anywhere;color:#374151;}
.detail-comments-section{padding:16px 18px 90px;}
.detail-comments-section h2{font-size:1.05rem;margin:0 0 12px;}
.comment-thread{display:grid;gap:10px;}
.thread-comment{position:relative;min-width:0;}
.comment-bubble{background:#fff;border:1px solid var(--ring);border-radius:16px;padding:11px 12px;box-shadow:0 8px 18px rgba(17,24,39,.04);min-width:0;}
.comment-meta{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;margin-bottom:4px;}
.comment-meta strong{font-size:.9rem;color:#111827;}.comment-meta span{font-size:.74rem;color:#8b93a1;font-weight:800;}
.comment-bubble p{margin:.15rem 0 .4rem;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:#374151;font-size:.92rem;line-height:1.45;}
.reply-link{border:0;background:transparent;color:var(--brand);font-weight:900;padding:0;cursor:pointer;font-size:.8rem;}
.comment-children{margin-left:20px;padding-left:12px;border-left:2px solid #e6e8ef;display:grid;gap:10px;margin-top:10px;}
.inline-reply-form,.detail-comment-form{display:grid;grid-template-columns:1fr auto auto auto;gap:8px;margin-top:8px;align-items:center;}
.detail-comment-form{position:sticky;bottom:0;background:rgba(255,255,255,.96);padding:12px 0 0;margin-top:16px;border-top:1px solid var(--ring);}
.inline-reply-form input,.detail-comment-form input{border-radius:999px;min-width:0;}
@media (max-width:760px){
  .composer{padding:10px!important;}.composer-trigger .avatar{width:34px;height:34px;font-size:.9rem;}.composer-trigger span{font-size:.9rem;padding:.62rem .8rem;}
  .expanded-composer textarea{min-height:86px;}.composer-actions{display:flex;flex-wrap:wrap;gap:8px;width:100%;align-items:center;}.composer-actions .voice-record-btn,.composer-actions .image-attach-btn{flex:0 0 auto;}.composer-actions .secondary-btn,.composer-actions .primary-btn{flex:1;min-width:90px;}.form-row{grid-template-columns:1fr!important;}
  .post-actions{gap:10px!important;}.icon-action{font-size:1rem;padding:5px 7px;}.heart-icon{font-size:1.15rem;}
  .post-detail-shell{max-width:none;width:100%;}.detail-topbar{height:54px;padding:0 12px;}.detail-post-card{padding:14px 14px 12px;}.detail-post-card h1{font-size:1.25rem;}
  .detail-comments-section{padding:14px 12px 86px;}.comment-bubble{padding:10px;border-radius:14px;}.comment-children{margin-left:10px;padding-left:9px;}
  .inline-reply-form{grid-template-columns:1fr;}.detail-comment-form{grid-template-columns:1fr auto auto auto;}.inline-reply-form .secondary-btn{width:100%;}
}

/* Like toggle state */
.icon-action.liked .heart-icon{color:#ef4444;}
.icon-action.liked .icon-count{color:#ef4444;}

/* Completed mission history on profile */
.completed-missions-card{
  margin-top:14px;
  padding:16px;
}
.completed-missions-card h3{
  margin:0 0 10px;
  font-size:1rem;
  letter-spacing:-.02em;
}
.completed-mission-list{
  display:grid;
  gap:8px;
}
.completed-mission-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--ring);
  border-radius:14px;
  background:#f9fafb;
  min-width:0;
}
.completed-mission-row div{
  min-width:0;
}
.completed-mission-row strong{
  display:block;
  font-size:.92rem;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.completed-mission-row span{
  display:block;
  color:var(--muted);
  font-size:.76rem;
  font-weight:700;
  margin-top:2px;
}
.completed-mission-row b{
  flex:0 0 auto;
  color:#047857;
  background:#dcfce7;
  border:1px solid #bbf7d0;
  border-radius:999px;
  padding:.28rem .5rem;
  font-size:.76rem;
}
@media (max-width:560px){
  .completed-mission-row{
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
  }
}

/* Admin / Noa Sensei styling */
.admin-post{
  border:1px solid rgba(250,204,21,.55)!important;
  background:linear-gradient(180deg,#fffdf2 0%, #ffffff 62%)!important;
  box-shadow:0 14px 34px rgba(250,204,21,.13), 0 10px 24px rgba(17,24,39,.055)!important;
}
.detail-post-card.admin-post{
  border-bottom:8px solid #fff7db!important;
}
.admin-avatar{
  background:linear-gradient(135deg,#f59e0b,#7c3aed)!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(245,158,11,.28)!important;
}
.admin-badge{
  display:inline-flex;
  align-items:center;
  margin-left:.4rem;
  padding:.16rem .45rem;
  border-radius:999px;
  background:#fff7db;
  color:#8a6100;
  border:1px solid rgba(250,204,21,.55);
  font-size:.68rem;
  font-weight:900;
  line-height:1;
  vertical-align:middle;
}
.admin-category{
  color:#8a6100!important;
  background:#fff7db!important;
  border-color:rgba(250,204,21,.55)!important;
}
.comment-meta .admin-badge{font-size:.62rem;padding:.12rem .35rem;}
@media (max-width:760px){
  .admin-badge{display:inline-flex;margin-left:.25rem;margin-top:.15rem;}
}

/* Post author cleanup: relative time + clean Noa teacher tag */
.author-copy{min-width:0;display:grid;gap:2px;align-content:center;}
.author-name-line{display:flex;align-items:center;gap:7px;min-width:0;line-height:1.15;}
.author-name-line strong{min-width:0;overflow-wrap:anywhere;}
.author-copy>span{display:block;color:#6b7280;font-size:.78rem;font-weight:800;line-height:1.2;}
.admin-badge{
  display:inline-flex!important;
  width:auto!important;
  max-width:max-content!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding:.22rem .48rem!important;
  border-radius:999px!important;
  background:linear-gradient(135deg,#fff7db,#fef3c7)!important;
  color:#8a6100!important;
  border:1px solid rgba(250,204,21,.65)!important;
  font-size:.68rem!important;
  font-weight:900!important;
  line-height:1!important;
  box-shadow:none!important;
}
.comment-meta{display:grid!important;gap:2px!important;align-items:start!important;}
.comment-meta .author-name-line{gap:6px;}
.comment-meta .admin-badge{font-size:.6rem!important;padding:.18rem .38rem!important;}
@media (max-width:760px){
  .author-name-line{gap:5px;flex-wrap:wrap;}
  .author-copy>span{font-size:.72rem;}
  .admin-badge{font-size:.62rem!important;padding:.18rem .4rem!important;}
}


.post{cursor:pointer;}
.post .icon-action,.detail-post-card .icon-action{cursor:pointer;}
.comment-icon{width:1.12em;height:1.12em;display:inline-flex;align-items:center;justify-content:center;color:currentColor;}
.comment-icon svg{width:100%;height:100%;display:block;}
.icon-action.static .comment-icon{cursor:default;}

/* Interactive daily exercise choices */
.exercise-block{
  display:grid;
  gap:10px;
  margin:.55rem 0 0;
  min-width:0;
}
.exercise-question{
  margin:0!important;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.post-edit-form,.comment-edit-form{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:6px 0;
}
.edit-title-input{
  font-size:1.1rem;
  font-weight:600;
  padding:6px 10px;
  border:1.5px solid var(--accent,#e06fa0);
  border-radius:8px;
  width:100%;
  box-sizing:border-box;
  font-family:inherit;
}
.edit-content-textarea,.edit-comment-textarea{
  padding:8px 10px;
  border:1.5px solid var(--accent,#e06fa0);
  border-radius:8px;
  resize:vertical;
  font-family:inherit;
  font-size:0.95rem;
  width:100%;
  box-sizing:border-box;
  min-height:72px;
}
.edit-form-actions{display:flex;gap:8px;}
.btn-edit-save,.btn-edit-cancel{
  padding:6px 18px;
  border-radius:8px;
  border:none;
  cursor:pointer;
  font-size:0.9rem;
  font-family:inherit;
  font-weight:600;
}
.btn-edit-save{background:var(--accent,#e06fa0);color:#fff;}
.btn-edit-save:hover{opacity:.85;}
.btn-edit-cancel{background:var(--surface2,#f3f3f3);color:var(--text,#222);}
.btn-edit-cancel:hover{background:var(--border,#ddd);}
.exercise-options{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:4px;
  max-width:520px;
}
.exercise-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  border-radius:14px;
  padding:10px 12px;
  font:inherit;
  font-weight:800;
  text-align:left;
  cursor:pointer;
  transition:transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.exercise-option:hover:not(:disabled){
  transform:translateY(-1px);
  border-color:#c7d2fe;
  background:#f8f7ff;
}
.exercise-option span{
  width:28px;
  height:28px;
  border-radius:999px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:#eef2ff;
  color:#4f46e5;
  font-size:.82rem;
}
.exercise-option b{
  min-width:0;
  overflow-wrap:anywhere;
  font-size:.95rem;
}
.exercise-option.is-correct{
  background:#dcfce7!important;
  border-color:#86efac!important;
  color:#166534!important;
}
.exercise-option.is-correct span{
  background:#16a34a!important;
  color:#fff!important;
}
.exercise-option.is-wrong{
  background:#fee2e2!important;
  border-color:#fca5a5!important;
  color:#991b1b!important;
}
.exercise-option.is-wrong span{
  background:#ef4444!important;
  color:#fff!important;
}
.exercise-option:disabled{
  cursor:default;
}
.exercise-result{
  width:max-content;
  max-width:100%;
  border-radius:999px;
  padding:.38rem .7rem;
  font-size:.82rem;
  font-weight:900;
}
.exercise-result.correct{
  background:#dcfce7;
  border:1px solid #86efac;
  color:#166534;
}
.exercise-result.wrong{
  background:#fee2e2;
  border:1px solid #fca5a5;
  color:#991b1b;
}
.yt-embed-wrap{
  position:relative;
  width:100%;
  padding-top:56.25%;
  border-radius:14px;
  overflow:hidden;
  margin:12px 0 4px;
  background:#000;
}
.yt-embed-wrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}
.exercise-note{
  margin:10px 0 0;
  font-size:.85rem;
  color:#6b7280;
  font-style:italic;
}
@media (max-width:760px){
  .exercise-options{max-width:100%;gap:7px;}
  .exercise-option{padding:9px 10px;border-radius:12px;}
  .exercise-option span{width:25px;height:25px;font-size:.76rem;}
  .exercise-option b{font-size:.88rem;}
}


/* Admin/owner delete controls */
.delete-post-btn{
  color:#9ca3af!important;
  opacity:.75;
}
.delete-post-btn:hover{
  color:#dc2626!important;
  background:#fee2e2!important;
  opacity:1;
}
@media (max-width:760px){
  .delete-post-btn{font-size:.92rem!important;padding:5px 7px!important;}
}

/* Voice exercise audio posts */
.voice-exercise-block{
  display:grid;
  gap:12px;
  margin:.55rem 0 0;
  min-width:0;
}
.voice-instruction{
  margin:0!important;
  color:#374151;
  font-weight:700;
}
.voice-player{
  display:none;
}
.pretty-audio-player{
  width:min(100%, 540px);
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:10px;
  padding:9px 11px;
  border-radius:18px;
  background:#fff;
  border:1px solid #e5e7eb;
  box-shadow:0 8px 20px rgba(17,24,39,.055);
}
.waveform-audio-player{
  background:linear-gradient(180deg,#ffffff 0%,#fafafa 100%);
}
.audio-control-btn{
  width:34px;
  height:34px;
  border:none;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
  flex:0 0 auto;
}
.audio-control-btn:hover{
  transform:translateY(-1px);
}
.audio-play-btn{
  background:#111827;
  color:#fff;
  box-shadow:0 8px 16px rgba(17,24,39,.18);
}
.audio-volume-btn{
  background:#f5f5f5;
  color:#111827;
  border:1px solid #e5e7eb;
}
.audio-icon{font-size:.82rem;line-height:1;}
.audio-volume-icon{font-size:.92rem;line-height:1;}
.pause-icon{display:none;font-size:.72rem;letter-spacing:-.08em;}
.pretty-audio-player.is-playing .play-icon{display:none;}
.pretty-audio-player.is-playing .pause-icon{display:inline;}
.audio-progress{
  appearance:none;
  border:none;
  background:transparent;
  padding:0;
  min-width:0;
  cursor:pointer;
  height:42px;
  display:flex;
  align-items:center;
}
.waveform-bars{
  width:100%;
  height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:2px;
  overflow:hidden;
}
.wave-bar{
  width:2px;
  height:var(--h);
  min-height:7px;
  border-radius:999px;
  background:#111827;
  opacity:.32;
  transform-origin:center;
  transition:opacity .12s ease, transform .12s ease, background .12s ease;
}
.wave-bar.is-played{
  opacity:1;
  background:#111827;
}
.pretty-audio-player.is-playing .wave-bar{
  animation:gentleWave 1.3s ease-in-out infinite;
}
.pretty-audio-player.is-playing .wave-bar:nth-child(3n){animation-delay:.08s;}
.pretty-audio-player.is-playing .wave-bar:nth-child(4n){animation-delay:.16s;}
.pretty-audio-player.is-muted .audio-volume-btn{
  color:#9ca3af;
}
.audio-progress-track,
.audio-progress-fill{
  display:none;
}
.voice-text{
  margin:0!important;
  padding:12px 14px;
  border-radius:14px;
  background:#fbfbff;
  border:1px solid #e0e7ff;
  color:#111827!important;
  font-weight:700;
  line-height:1.7!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere;
}
@keyframes gentleWave{
  0%,100%{transform:scaleY(1);}
  50%{transform:scaleY(1.12);}
}
@media (max-width:760px){
  .pretty-audio-player{width:100%;gap:8px;padding:8px 9px;border-radius:16px;}
  .audio-control-btn{width:32px;height:32px;}
  .audio-progress{height:36px;}
  .waveform-bars{height:34px;gap:1.5px;}
  .wave-bar{width:1.6px;}
  .voice-text{padding:10px 12px;border-radius:12px;font-size:.88rem!important;}
}

/* Voice comments */
.voice-record-btn{
  width:40px;
  height:40px;
  border:1px solid #e5e7eb;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  background:#fff;
  color:#4b5563;
  box-shadow:none;
  transition:transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.voice-record-btn:hover{transform:translateY(-1px);border-color:#c7d2fe;background:#f8f7ff;color:#4f46e5;}
.icon-send-btn{
  width:40px;
  height:40px;
  min-width:40px;
  border:0;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  color:#fff;
  box-shadow:0 4px 12px rgba(79,70,229,.3);
  transition:transform .15s ease, box-shadow .15s ease;
}
.icon-send-btn:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(79,70,229,.38);}
.attach-icon{width:19px;height:19px;display:inline-flex;align-items:center;justify-content:center;}
.attach-icon svg{width:100%;height:100%;display:block;}
.record-stop-dot{width:12px;height:12px;border-radius:4px;background:currentColor;display:block;}
.voice-comment-form.is-recording .voice-record-btn{
  background:#fee2e2;
  color:#dc2626;
  animation:voicePulse 1.1s ease-in-out infinite;
}
.voice-comment-form.has-recording .voice-record-btn{
  background:#dcfce7;
  color:#047857;
}
.voice-comment-form.is-uploading{
  opacity:.75;
  pointer-events:none;
}
.voice-record-status{
  grid-column:1 / -1;
  min-height:18px;
  color:#6b7280;
  font-size:.78rem;
  font-weight:700;
  padding-left:6px;
}
.comment-audio-player{
  width:100%;
  max-width:360px;
  padding:8px 10px;
  margin:.45rem 0 .5rem;
  box-shadow:0 8px 16px rgba(91,77,255,.06);
}
.comment-audio-player .audio-control-btn{
  width:34px;
  height:34px;
}
.comment-audio-player .audio-progress-track{
  height:6px;
}
@keyframes voicePulse{
  0%,100%{transform:scale(1);}
  50%{transform:scale(1.08);}
}
@media (max-width:760px){
  .detail-comment-form{grid-template-columns:1fr auto auto auto!important;}
  .inline-reply-form{grid-template-columns:1fr auto auto auto!important;}
  .inline-reply-form .secondary-btn{grid-column:1 / -1;}
  .voice-record-btn{width:38px;height:38px;}
}


/* Diagnostic native audio for user voice comments */
.native-audio-wrap{
  display:grid;
  gap:6px;
  margin:.5rem 0 .55rem;
  max-width:420px;
}
.native-audio-player{
  width:100%;
  max-width:420px;
  display:block;
}
.audio-debug-link{
  font-size:.75rem;
  font-weight:800;
  color:#4f46e5;
  text-decoration:underline;
  word-break:break-all;
}
.voice-preview-slot{
  grid-column:1 / -1;
  min-width:0;
}
.voice-preview-card{
  display:grid;
  gap:7px;
  padding:10px;
  border-radius:14px;
  border:1px solid #dbe4ff;
  background:#fbfbff;
}
.voice-preview-card span{
  color:#111827;
  font-size:.82rem;
  font-weight:900;
}
.voice-preview-card small{
  color:#6b7280;
  font-size:.72rem;
  line-height:1.35;
  font-weight:700;
}
.voice-preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.voice-discard-btn{
  border:0;
  background:transparent;
  color:#9ca3af;
  font-size:1.2rem;
  line-height:1;
  padding:2px 4px;
  cursor:pointer;
  border-radius:6px;
  transition:color .15s ease, background .15s ease;
}
.voice-discard-btn:hover{color:#ef4444;background:#fee2e2;}
.voice-custom-player{
  display:flex;
  align-items:center;
  gap:8px;
}
.audio-play-btn{
  width:32px;
  height:32px;
  min-width:32px;
  border:0;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  transition:transform .15s ease;
}
.audio-play-btn:hover{transform:scale(1.08);}
.audio-progress-bar{
  flex:1;
  height:4px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
}
.audio-progress-fill{
  height:100%;
  width:0%;
  background:var(--brand);
  border-radius:999px;
  transition:width .1s linear;
}
.audio-time{
  font-size:.75rem;
  font-weight:700;
  color:#6b7280;
  white-space:nowrap;
}
.hidden-audio{display:none!important;}
.comment-audio-player{
  padding:0!important;
  box-shadow:none!important;
}
@media (max-width:760px){
  .native-audio-wrap,
  .native-audio-player{max-width:100%;}
}

/* GENOA typography/design refresh — lighter small text, Helvetica-style body */
:root{
  --ink:#111827;
  --muted:#667085;
  --bg:#f7f7fb;
  --ring:#e7e7ef;
  --soft:#f0efff;
}
html, body{
  font-family:"Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif!important;
  font-weight:400;
  letter-spacing:-.005em;
  color:var(--ink);
}
h1,h2,h3,
.brand,.logo,
.post h1,.post h2,
.page-intro h1,.page-panel h1,
.section-heading h1,.section-heading h2,
.auth-view h2{
  font-family:Poppins,"Helvetica Neue",Helvetica,Arial,sans-serif!important;
}
.brand,
.logo,
.page-intro h1,
.page-panel h1,
.post h2,
.detail-post-card h1,
.section-heading h2{
  font-weight:750!important;
}
body,
p,
input,
textarea,
select,
button,
.comment,
.author span,
.muted,
.small{
  font-weight:400;
}
.brand small,
.page-intro p,
.author span,
.comment-meta,
.leader-main span,
.profile-info p,
.event span,
.calendar-item span{
  font-weight:500!important;
  color:#667085!important;
}
button,
.primary-btn,
.secondary-btn,
.join-btn,
.ghost-btn,
.quick-link,
.chip,
.category,
.xp-pill,
.mission-status,
.action-btn,
.icon-action,
.leader-name,
.leader-xp,
.leader-level{
  font-weight:650!important;
}
.card{
  border-color:#e9e9f2!important;
  box-shadow:0 8px 24px rgba(17,24,39,.045)!important;
}
.post,
.box,
.composer,
.page-panel,
.comment,
.auth-dialog{
  box-shadow:0 8px 24px rgba(17,24,39,.04)!important;
}
.post p,
.comment,
.comment p,
.voice-text,
.exercise-question{
  color:#2f3747!important;
  font-weight:400!important;
  letter-spacing:-.01em;
}
.voice-text,
.exercise-question{
  font-weight:500!important;
}
.author strong,
.comment strong,
.completed-mission-row strong{
  font-family:"Helvetica Neue",Helvetica,Arial,system-ui,sans-serif!important;
  font-weight:650!important;
}
input,textarea,select{
  font-weight:400!important;
  border-color:#e4e7ec!important;
}
input::placeholder,textarea::placeholder{
  color:#98a2b3!important;
  font-weight:400!important;
}
.post h2,
.detail-post-card h1{
  line-height:1.22!important;
}
.comment{
  background:#fcfcfd!important;
}
.voice-comment-audio,
.comment-audio,
.native-comment-audio,
.comment audio,
.voice-comment audio{
  max-width:100%;
}

/* Softer compact mobile typography */
@media (max-width:760px){
  body{font-size:14px!important;line-height:1.5!important;}
  .page-intro h1,.page-panel h1{font-size:1.7rem!important;}
  .post h2{font-size:1.03rem!important;}
  .post p,.comment,.comment p,.voice-text,.exercise-question{font-size:.9rem!important;line-height:1.5!important;}
  .author strong{font-size:.9rem!important;}
  .author span{font-size:.74rem!important;}
  .category,.chip,.quick-link{font-size:.76rem!important;}
  .brand span:last-child{font-weight:750!important;}
  .brand small{font-weight:500!important;}
}


/* Waveform voice comment player */
.comment-audio-wrap{
  display:grid;
  gap:6px;
  margin-top:8px;
  max-width:520px;
}
.comment-wave-player{
  max-width:460px;
  padding:7px 9px;
  border-radius:16px;
  background:#fff;
}
.comment-wave-player .audio-control-btn{
  width:30px;
  height:30px;
}
.comment-wave-player .audio-progress{
  height:34px;
}
.comment-wave-player .waveform-bars{
  height:30px;
}
.comment-wave-player .wave-bar{
  width:1.7px;
  min-height:5px;
}
.audio-debug-link.subtle{
  font-size:.72rem!important;
  font-weight:600!important;
  color:#9ca3af!important;
  text-decoration:none!important;
}
.audio-debug-link.subtle:hover{
  color:#6d4aff!important;
  text-decoration:underline!important;
}
.voice-preview-card .native-audio-player{
  height:34px;
}
@media (max-width:760px){
  .comment-audio-wrap{max-width:100%;}
  .comment-wave-player{max-width:100%;}
}

/* Comment system refinement */
/* ── Feed posts: collapsed preview ──────────────────────────────────────── */
#postsContainer .post .post-body-feed{
  max-height:280px;
  overflow:hidden;
}
#postsContainer .post.no-collapse .post-body-feed{
  max-height:none;
  overflow:visible;
}

.feed-expand-hint{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:8px;
  font-size:.8rem;
  font-weight:800;
  color:var(--brand);
  cursor:pointer;
  opacity:.75;
}
.feed-expand-hint:hover{opacity:1;}

/* Commenter avatar bubbles — inline in the actions row */
.commenter-bubbles{
  display:flex;
  align-items:center;
  margin-left:2px;
}
.commenter-bubble{
  width:34px;
  height:34px;
  border-radius:999px;
  border:2px solid #fff;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  color:#fff;
  font-size:.65rem;
  font-weight:900;
  display:grid;
  place-items:center;
  margin-left:-8px;
  flex-shrink:0;
  overflow:hidden;
  box-shadow:0 1px 4px rgba(17,24,39,.12);
}
.commenter-bubble:first-child{margin-left:0;}
.commenter-bubble.image-avatar{background:#f3f4f6;}
.commenter-bubble.image-avatar img{width:100%;height:100%;object-fit:cover;display:block;}

.compact-comment{
  display:grid;
  grid-template-columns:32px 1fr;
  gap:9px;
  align-items:start;
  min-width:0;
}
.compact-comment-body{min-width:0;}
.compact-comment-meta{
  display:flex;align-items:center;gap:7px;min-width:0;flex-wrap:wrap;margin-bottom:2px;
}
.compact-comment-meta strong{font-size:.82rem;font-weight:700;color:#111827;}
.compact-comment-meta span{font-size:.72rem;color:#8b93a1;font-weight:500;}
.compact-comment p{margin:0 0 4px!important;color:#4b5563!important;font-size:.86rem!important;line-height:1.45!important;overflow-wrap:anywhere;white-space:pre-wrap;}
.compact-comment-actions{display:flex;align-items:center;gap:8px;margin-top:2px;}
.view-all-comments{
  justify-self:start;
  border:0;
  background:transparent;
  color:#6d4aff;
  font-size:.78rem;
  font-weight:700;
  cursor:pointer;
  padding:2px 0;
}
.view-all-comments:hover{text-decoration:underline;}
.comment-avatar-col{
  min-width:0;
}
.comment-avatar{
  width:34px;
  height:34px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#6d4aff,#7c3aed);
  color:#fff;
  font-weight:800;
  font-size:.9rem;
  box-shadow:0 8px 16px rgba(109,74,255,.16);
  overflow:hidden;
}
.comment-avatar.image-avatar{background:#f3f4f6;box-shadow:none;}
.comment-avatar img{width:100%;height:100%;object-fit:cover;display:block;}

/* Avatar level badge */
.avatar-wrap{position:relative;display:inline-flex;flex-shrink:0;cursor:pointer;}
.avatar-wrap:hover{opacity:.85;}
.level-badge{
  position:absolute;
  bottom:-4px;
  right:-4px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  background:#fff;
  color:var(--brand);
  font-size:.6rem;
  font-weight:900;
  line-height:18px;
  text-align:center;
  border-radius:999px;
  border:1.5px solid var(--brand);
  white-space:nowrap;
  pointer-events:none;
  z-index:1;
  letter-spacing:-.01em;
  box-shadow:0 1px 4px rgba(0,0,0,.18);
}
.thread-comment{
  display:grid;
  grid-template-columns:36px 1fr;
  gap:9px;
  min-width:0;
}
.thread-comment.depth-1,
.thread-comment.depth-2,
.thread-comment.depth-3,
.thread-comment.depth-4{
  margin-top:8px;
}
.comment-main{min-width:0;}
.comment-author-line{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.comment-author-line strong{
  font-size:.86rem!important;
  font-weight:700!important;
  color:#111827!important;
}
.comment-author-line span{
  font-size:.72rem!important;
  color:#8b93a1!important;
  font-weight:500!important;
}
.comment-actions-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:6px;
}
.comment-like-btn{
  border:0;
  background:transparent;
  color:#687080;
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:0;
  cursor:pointer;
  font-size:.86rem;
  font-weight:700;
}
.comment-like-btn span{font-size:1rem;line-height:1;}
.comment-like-btn b{font-size:.78rem;color:#6b7280;}
.comment-like-btn.liked,
.comment-like-btn.liked b{color:#ef4444;}
.comment-bubble{
  box-shadow:none!important;
  background:#fcfcfd!important;
}
.comment-bubble p{
  font-weight:400!important;
}
.reply-link{
  font-weight:700!important;
  color:#6d4aff!important;
}
.comment-children{
  margin-left:0!important;
  padding-left:10px!important;
  border-left:1.5px solid #e5e7eb!important;
  gap:8px!important;
}
.voice-preview-card small,
.audio-debug-link,
.audio-debug-link.subtle{
  display:none!important;
}
.voice-preview-card{
  padding:8px 10px!important;
  gap:6px!important;
  background:#f8fafc!important;
  border-color:#e5e7eb!important;
}
.voice-preview-card span{
  font-size:.78rem!important;
  font-weight:650!important;
  color:#4b5563!important;
}
.voice-record-status{
  font-weight:500!important;
  color:#8b93a1!important;
}
.compact-audio-player{
  max-width:380px!important;
  margin:6px 0 2px!important;
}
@media (max-width:760px){
  .feed-comment-preview{padding:9px;border-radius:16px;}
  .compact-comment{grid-template-columns:30px 1fr;gap:8px;}
  .comment-avatar{width:30px;height:30px;font-size:.82rem;}
  .thread-comment{grid-template-columns:32px 1fr;gap:8px;}
  .comment-author-line strong{font-size:.82rem!important;}
  .comment-author-line span{font-size:.68rem!important;}
  .comment-actions-row{gap:10px;}
  .compact-audio-player{max-width:100%!important;}
}


/* Comment preview formatting fix */
.feed-comment-preview{
  margin:16px 0 8px!important;
  padding:14px!important;
  border-radius:18px!important;
  background:#ffffff!important;
  border:1px solid #eaedf5!important;
  box-shadow:0 8px 20px rgba(17,24,39,.035)!important;
}
.feed-comments-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 10px;
}
.feed-comments-head h3{
  margin:0!important;
  font-size:.9rem!important;
  line-height:1.1!important;
  letter-spacing:-.01em;
  color:#111827!important;
  font-weight:750!important;
  font-family:Poppins,"Helvetica Neue",Helvetica,Arial,sans-serif!important;
}
.feed-comments-list{
  display:grid;
  gap:10px;
}
.compact-comment{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:flex-start!important;
  min-width:0!important;
  padding:0!important;
}
.compact-comment + .compact-comment{
  padding-top:10px!important;
  border-top:1px solid #f0f2f7!important;
}
.compact-comment-body{
  min-width:0!important;
  display:grid!important;
  gap:4px!important;
}
.compact-comment-meta{
  display:flex!important;
  align-items:baseline!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  margin:0!important;
  min-width:0!important;
}
.compact-comment-meta strong{
  font-size:.86rem!important;
  font-weight:700!important;
  color:#111827!important;
  line-height:1.2!important;
}
.compact-comment-meta span{
  font-size:.74rem!important;
  color:#8b93a1!important;
  font-weight:500!important;
  line-height:1.2!important;
}
.compact-comment p,
.compact-comment .voice-comment-label{
  margin:0!important;
  color:#374151!important;
  font-size:.9rem!important;
  line-height:1.45!important;
  font-weight:400!important;
  overflow-wrap:anywhere!important;
  white-space:pre-wrap!important;
}
.compact-comment .voice-comment-label{
  color:#6b7280!important;
  font-style:normal!important;
}
.compact-comment-actions,
.comment-actions-row{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  margin-top:4px!important;
}
.comment-like-btn,
.compact-reply-btn,
.reply-link,
.view-all-comments{
  appearance:none!important;
  -webkit-appearance:none!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:none!important;
  padding:0!important;
  min-width:0!important;
  width:auto!important;
  height:auto!important;
  border-radius:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:4px!important;
  cursor:pointer!important;
  font-size:.78rem!important;
  line-height:1.2!important;
  font-weight:650!important;
  color:#6b7280!important;
  text-decoration:none!important;
}
.comment-like-btn span{font-size:.98rem!important;line-height:1!important;display:inline-block!important;}
.comment-like-btn b{font-size:.78rem!important;color:inherit!important;font-weight:650!important;}
.comment-like-btn.liked,
.comment-like-btn.liked b{color:#ef4444!important;}
.compact-reply-btn,
.reply-link,
.view-all-comments{color:#6d4aff!important;}
.compact-reply-btn:hover,
.reply-link:hover,
.view-all-comments:hover{text-decoration:underline!important;}
.view-all-comments{white-space:nowrap!important;}
.comment-avatar{
  flex:none!important;
}
.compact-audio-player{
  max-width:420px!important;
  margin:6px 0 2px!important;
}
.compact-audio-player .pretty-audio-player,
.compact-audio-player.comment-audio-wrap{
  width:100%!important;
}
@media (max-width:760px){
  .feed-comment-preview{padding:12px!important;border-radius:16px!important;margin:14px 0 8px!important;}
  .compact-comment{grid-template-columns:30px minmax(0,1fr)!important;gap:8px!important;}
  .feed-comments-head h3{font-size:.86rem!important;}
  .compact-comment p,.compact-comment .voice-comment-label{font-size:.86rem!important;}
  .compact-comment-meta strong{font-size:.82rem!important;}
  .compact-comment-meta span{font-size:.7rem!important;}
  .compact-audio-player{max-width:100%!important;}
}

/* Image attachments */
.image-attach-btn{
  min-width:40px;
  height:40px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#4b5563;
  border-radius:999px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.image-attach-btn:hover{transform:translateY(-1px);border-color:#c7d2fe;background:#f8f7ff;color:#4f46e5;}
.image-preview-slot{width:100%;}
.image-preview-card{
  position:relative;
  width:min(100%, 360px);
  margin:8px 0;
  border-radius:18px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  background:#f9fafb;
}
.image-preview-card img{
  display:block;
  width:100%;
  max-height:260px;
  object-fit:cover;
}
.remove-image-btn{
  position:absolute;
  top:8px;
  right:8px;
  width:30px;
  height:30px;
  border:0;
  border-radius:999px;
  background:rgba(17,24,39,.82);
  color:#fff;
  font-size:1.1rem;
  cursor:pointer;
  line-height:1;
}
.image-attachment{
  display:block;
  margin:12px 0 0;
  border-radius:18px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  max-width:620px;
}
.image-attachment img{
  display:block;
  width:100%;
  max-height:520px;
  object-fit:cover;
}
.comment-image,
.compact-comment-image{
  max-width:360px;
  border-radius:16px;
  margin-top:8px;
}
.comment-image img,
.compact-comment-image img{
  max-height:300px;
}
.detail-comment-form,
.inline-reply-form{
  align-items:center;
  flex-wrap:wrap;
}
.detail-comment-form .image-preview-slot,
.inline-reply-form .image-preview-slot,
.detail-comment-form .voice-preview-slot,
.inline-reply-form .voice-preview-slot,
.detail-comment-form .voice-record-status,
.inline-reply-form .voice-record-status{
  flex-basis:100%;
}
@media (max-width:760px){
  .image-attachment{border-radius:14px;}
  .image-attachment img{max-height:360px;}
  .image-preview-card{width:100%;border-radius:14px;}
  .comment-image,.compact-comment-image{max-width:100%;}
  .image-attach-btn{height:38px;min-width:38px;border-radius:12px;}
}


/* Compact image attachments + lightbox */
.image-attachment{
  appearance:none;
  border:0;
  padding:0;
  background:transparent;
  cursor:pointer;
  display:block;
  margin:10px 0 0;
  border-radius:14px;
  overflow:hidden;
  max-width:420px;
  box-shadow:none;
}
.image-attachment img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .18s ease, filter .18s ease;
}
.image-attachment:hover img{
  transform:scale(1.02);
  filter:brightness(.96);
}
.post-image{
  width:min(100%, 420px);
  aspect-ratio:16/10;
}
.post-image img{
  max-height:none!important;
}
.comment-image,
.compact-comment-image{
  width:150px!important;
  height:110px!important;
  max-width:150px!important;
  border-radius:12px!important;
  margin-top:8px!important;
}
.comment-image img,
.compact-comment-image img{
  width:100%!important;
  height:100%!important;
  max-height:none!important;
  object-fit:cover!important;
}
.comment-author-line span,
.compact-comment-meta span{
  color:#6b7280;
  font-weight:500!important;
}
.image-lightbox{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  background:rgba(3,7,18,.86);
  backdrop-filter:blur(8px);
}
.image-lightbox.hidden{display:none!important;}
.image-lightbox img{
  max-width:min(96vw, 1100px);
  max-height:88vh;
  object-fit:contain;
  border-radius:18px;
  box-shadow:0 26px 80px rgba(0,0,0,.35);
}
.image-lightbox-close{
  position:fixed;
  top:18px;
  right:18px;
  width:42px;
  height:42px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:1.8rem;
  line-height:1;
  cursor:pointer;
}
.image-lightbox-close:hover{background:rgba(255,255,255,.24);}
@media (max-width:760px){
  .post-image{width:100%;aspect-ratio:4/3;}
  .comment-image,.compact-comment-image{
    width:132px!important;
    height:96px!important;
    max-width:132px!important;
  }
  .image-lightbox{padding:12px;}
  .image-lightbox img{max-width:96vw;max-height:84vh;border-radius:14px;}
  .image-lightbox-close{top:12px;right:12px;width:38px;height:38px;}
}


/* Permission + compact attachment preview fix */
.image-preview-card{
  width:96px!important;
  height:96px!important;
  max-width:96px!important;
  margin:8px 0 4px!important;
  border-radius:14px!important;
  box-shadow:0 8px 20px rgba(17,24,39,.08)!important;
}
.image-preview-card img{
  width:100%!important;
  height:100%!important;
  max-height:none!important;
  object-fit:cover!important;
}
.remove-image-btn{
  width:24px!important;
  height:24px!important;
  top:5px!important;
  right:5px!important;
  font-size:.95rem!important;
}
.detail-comment-form .image-preview-slot,
.inline-reply-form .image-preview-slot{
  flex-basis:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}
.voice-record-status{
  font-size:.72rem!important;
  font-weight:500!important;
  color:#9ca3af!important;
}
.delete-post-btn{
  display:inline-flex!important;
}
@media (max-width:760px){
  .image-preview-card{
    width:82px!important;
    height:82px!important;
    max-width:82px!important;
    border-radius:12px!important;
  }
  .detail-comment-form .image-preview-slot,
  .inline-reply-form .image-preview-slot{
    padding-left:2px!important;
  }
}


/* Preserve post/comment formatting */
.post-content,
.comment-text,
.compact-comment-text{
  margin:.35rem 0 0;
  color:#2f3747;
  font-weight:400;
  line-height:1.62;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.post-content{
  font-size:1rem;
}
.detail-post-card .post-content{
  font-size:1.02rem;
  line-height:1.68;
}
.comment-text,
.compact-comment-text{
  font-size:.92rem;
  line-height:1.5;
}
.compact-comment-text{
  margin:0 0 4px!important;
  color:#4b5563!important;
  font-size:.86rem!important;
}
.post-content a,
.comment-text a,
.compact-comment-text a{
  color:#4f46e5;
  font-weight:600;
  text-decoration:none;
  word-break:break-all;
}
.post-content a:hover,
.comment-text a:hover,
.compact-comment-text a:hover{
  text-decoration:underline;
}
@media (max-width:760px){
  .post-content{font-size:.9rem!important;line-height:1.55!important;}
  .detail-post-card .post-content{font-size:.92rem!important;line-height:1.58!important;}
  .comment-text,.compact-comment-text{font-size:.86rem!important;line-height:1.48!important;}
}


/* Mobile comment composer stability + iOS no-zoom fix */
.post-detail-shell{
  padding-bottom:0;
}
.detail-comments-section{
  padding-bottom:150px!important;
}
.detail-comment-form{
  position:fixed!important;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:min(820px, 100vw);
  z-index:80;
  margin:0!important;
  padding:12px 18px calc(12px + env(safe-area-inset-bottom))!important;
  background:rgba(255,255,255,.98)!important;
  backdrop-filter:blur(14px);
  border-top:1px solid var(--ring)!important;
  box-shadow:0 -10px 28px rgba(17,24,39,.08);
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto auto;
  align-items:center;
  gap:8px;
}
.detail-comment-form.hidden{display:none!important;}
.detail-comment-form input,
.detail-comment-form textarea,
.detail-comment-form select,
.inline-reply-form input,
.inline-reply-form textarea,
.inline-reply-form select{
  font-size:16px!important;
}
.detail-comment-form input{
  min-height:46px;
}
.comment-textarea{
  width:100%;min-width:0;box-sizing:border-box;resize:none;
  min-height:46px;max-height:150px;overflow-y:auto;
  padding:12px 16px;line-height:1.4;border-radius:22px;
  border:1px solid var(--ring);background:#fff;font-family:inherit;
}
.comment-textarea:focus{outline:none;border-color:var(--brand);}
.detail-comment-form .primary-btn{
  min-height:46px;
  padding:.72rem 1rem;
}
.detail-comment-form .voice-btn,
.detail-comment-form .attachment-btn,
.detail-comment-form .icon-upload-btn,
.detail-comment-form .icon-send-btn,
.detail-comment-form .voice-record-btn,
.detail-comment-form .image-attach-btn{
  width:46px!important;
  height:46px!important;
  min-width:46px!important;
}
@media (max-width:760px){
  .post-detail-shell{
    height:100dvh;
    padding-bottom:0;
  }
  .detail-comments-section{
    padding-bottom:160px!important;
  }
  .detail-comment-form{
    left:0;
    right:0;
    transform:none;
    width:100vw;
    grid-template-columns:minmax(0,1fr) auto auto auto;
    padding:10px 12px calc(12px + env(safe-area-inset-bottom))!important;
  }
  input, textarea, select{
    font-size:16px!important;
  }
}


/* Profile pictures */
.avatar.image-avatar,
.comment-avatar.image-avatar,
.profile-photo.image-avatar{
  background:#f3f4f6!important;
  overflow:hidden;
  box-shadow:none;
}
.avatar.image-avatar img,
.comment-avatar.image-avatar img,
.profile-photo.image-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
/* Circular level ring around profile photo */
.profile-avatar-wrap{
  position:relative;
  width:120px;
  height:120px;
  border-radius:999px;
  background:conic-gradient(var(--brand) var(--ring-progress,0%), #e5e7eb 0);
  padding:7px;
  margin:0 auto;
}
.profile-avatar-wrap .profile-photo{
  width:106px!important;
  height:106px!important;
  box-shadow:none!important;
}
.profile-ring-badge{
  position:absolute;
  bottom:-2px;
  left:50%;
  transform:translateX(-50%);
  background:linear-gradient(135deg,var(--brand),var(--purple));
  color:#fff;
  font-size:.65rem;
  font-weight:900;
  padding:2px 9px;
  border-radius:999px;
  white-space:nowrap;
  box-shadow:0 2px 8px rgba(79,70,229,.28);
  pointer-events:none;
}

/* Bell notification button */
.bell-btn{
  position:relative;
  width:38px;
  height:38px;
  border:0;
  background:transparent;
  color:#6b7280;
  cursor:pointer;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background .15s ease,color .15s ease;
  flex-shrink:0;
}
.bell-btn:hover{background:#f3f4f6;color:var(--brand);}
.bell-badge{
  position:absolute;
  top:4px;right:4px;
  min-width:16px;height:16px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:.6rem;font-weight:900;
  display:flex;align-items:center;justify-content:center;
  padding:0 3px;
  pointer-events:none;
}

/* Notification panel */
.notif-panel{
  position:fixed;
  top:66px;right:12px;
  width:min(340px,calc(100vw - 24px));
  max-height:70vh;
  overflow-y:auto;
  background:#fff;
  border:1px solid var(--ring);
  border-radius:18px;
  box-shadow:0 16px 40px rgba(17,24,39,.12);
  z-index:90;
  padding:10px;
}
.notif-header{
  padding:6px 4px 10px;
  border-bottom:1px solid var(--ring);
  margin-bottom:6px;
  font-size:.9rem;
}
.notif-item{
  display:grid;
  gap:2px;
  width:100%;
  text-align:left;
  border:0;background:transparent;
  padding:10px 8px;
  border-radius:12px;
  cursor:pointer;
  transition:background .12s ease;
}
.notif-item:hover{background:#f9fafb;}
.notif-item.notif-new{background:#eef2ff;}
.notif-item.notif-new:hover{background:#e0e7ff;}
.notif-cat{font-size:.72rem;font-weight:900;color:var(--brand);}
.notif-cat-mention{color:#7c3aed;}
.notif-cat-reply{color:#0ea5e9;}
.notif-cat-gift{color:#d97706;display:inline-flex;align-items:center;gap:3px;}
.notif-title{font-size:.9rem;font-weight:700;color:#111827;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:280px;}
.notif-time{font-size:.73rem;color:#9ca3af;font-weight:600;}
.notif-empty{padding:12px 8px;margin:0;}

/* Nopis info popup */
.nopis-popup{
  position:fixed;
  top:66px;right:12px;
  width:min(320px,calc(100vw - 24px));
  background:#fff;
  border:1px solid var(--ring);
  border-radius:20px;
  box-shadow:0 16px 40px rgba(17,24,39,.12);
  z-index:90;
  padding:18px 16px 14px;
}
.nopis-popup-close{
  position:absolute;
  top:10px;right:12px;
  border:0;background:transparent;
  font-size:1.3rem;color:#9ca3af;
  cursor:pointer;line-height:1;padding:4px 6px;
  border-radius:6px;transition:color .15s ease;
}
.nopis-popup-close:hover{color:#111827;}
.nopis-popup-title{font-size:1.05rem;font-weight:900;margin-bottom:8px;padding-right:28px;}
.nopis-popup p{font-size:.87rem;color:#374151;margin:8px 0;}
.nopis-popup-section{font-size:.73rem;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:14px 0 8px;}
.nopis-earn-table{display:grid;gap:0;}
.nopis-earn-row{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #f3f4f6;font-size:.86rem;}
.nopis-earn-row:last-child{border-bottom:0;}
.nopis-earn-row b{color:#047857;font-weight:900;}
.nopis-earn-row.sep{border-bottom:1px solid #e5e7eb;padding:0;height:6px;}
.nopis-cap-note{font-size:.78rem!important;color:var(--muted)!important;margin-top:12px!important;padding-top:10px!important;border-top:1px solid var(--ring);}

/* Admin dashboard panel */
.admin-dash-panel{
  position:fixed;
  top:66px;right:12px;
  width:min(400px,calc(100vw - 24px));
  max-height:80vh;
  overflow-y:auto;
  background:#fff;
  border:1px solid var(--ring);
  border-radius:18px;
  box-shadow:0 16px 40px rgba(17,24,39,.12);
  z-index:90;
  padding:10px;
}
.dash-section-label{
  padding:10px 4px 6px;
  font-size:.72rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
}
.dash-stats-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:4px;
}
.dash-stat-card{
  background:var(--soft);
  border:1px solid #e0e7ff;
  border-radius:14px;
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.dash-stat-card strong{
  font-size:1.5rem;
  font-weight:900;
  color:var(--brand);
  line-height:1;
}
.dash-stat-card span{
  font-size:.75rem;
  color:var(--muted);
  font-weight:700;
}
.dash-reply-item{
  display:grid;
  gap:8px;
  padding:10px 8px;
  border-radius:12px;
  transition:background .12s ease;
}
.dash-reply-item:hover{background:#f9fafb;}
.dash-reply-new{background:#eef2ff;}
.dash-reply-new:hover{background:#e0e7ff;}
.dash-reply-head{
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.dash-reply-meta{
  display:grid;
  gap:1px;
  min-width:0;
}
.dash-reply-meta strong{
  font-size:.9rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dash-audio{
  width:100%;
  height:36px;
  border-radius:999px;
  accent-color:var(--brand);
}
.dash-view-post-btn{
  padding:.5rem .75rem;
  font-size:.8rem;
  justify-self:start;
}

/* ── Noa Admin Page ──────────────────────────────────────────────────────── */
.noa-admin-page{max-width:720px;margin:0 auto;padding:24px 16px 60px;}
.noa-admin-header{margin-bottom:20px;}
.noa-admin-header h2{font-size:1.4rem;font-weight:900;margin:0 0 4px;}
.noa-section-title{
  font-size:.78rem;font-weight:900;text-transform:uppercase;
  letter-spacing:.07em;color:var(--muted);margin:20px 0 10px;
}
.noa-stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.noa-stat-card{
  background:var(--soft);border:1px solid #e0e7ff;border-radius:14px;
  padding:14px 12px;display:flex;flex-direction:column;gap:2px;
}
.noa-stat-icon{font-size:1.2rem;line-height:1;margin-bottom:4px;}
.noa-stat-card strong{font-size:1.6rem;font-weight:900;color:var(--brand);line-height:1;}
.noa-stat-card span{font-size:.72rem;color:var(--muted);font-weight:700;}
.noa-cal-form{padding:16px;margin-bottom:16px;}
.noa-form-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px;}
.noa-form-textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:56px;font-size:.88rem;}
.noa-color-opt{display:inline-flex;align-items:center;cursor:pointer;}
.noa-color-dot{display:inline-block;width:16px;height:16px;border-radius:50%;margin-left:3px;border:2px solid transparent;}
.noa-color-opt input{display:none;}
.noa-color-opt input:checked + .noa-color-dot{border-color:#374151;box-shadow:0 0 0 2px #fff,0 0 0 3px #374151;}
.noa-color-brand{background:var(--brand);}
.noa-color-green{background:#16a34a;}
.noa-color-red{background:#dc2626;}
.noa-color-purple{background:#7c3aed;}
.noa-event-list-label{
  font-size:.78rem;font-weight:900;text-transform:uppercase;
  letter-spacing:.07em;color:var(--muted);margin:0 0 8px;
}
.noa-event-item{
  display:flex;align-items:flex-start;gap:10px;
  padding:10px 12px;border-radius:12px;background:var(--soft);margin-bottom:8px;
}
.noa-event-item-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;}
.noa-event-item-info strong{font-size:.9rem;}
.noa-meet-link{font-size:.78rem;color:var(--brand);text-decoration:none;}
.noa-meet-link:hover{text-decoration:underline;}
.noa-event-delete-btn{padding:.3rem .6rem;font-size:.78rem;flex-shrink:0;border-radius:8px;}
.noa-admin-loading{padding:40px;text-align:center;color:var(--muted);}
/* DB calendar event dots */
.calendar-db-dot{
  display:inline-block;width:5px;height:5px;border-radius:50%;
  background:var(--brand);margin:0 1px;vertical-align:middle;
}
.calendar-db-dot.dot-green{background:#16a34a;}
.calendar-db-dot.dot-red{background:#dc2626;}
.calendar-db-dot.dot-purple{background:#7c3aed;}
.noa-db-event-row{
  display:flex;flex-direction:column;gap:3px;
  padding:10px 14px;border-radius:12px;background:var(--soft);
}
.noa-db-event-row + .noa-db-event-row{margin-top:8px;}
.noa-db-event-title{font-size:.9rem;font-weight:800;}
.noa-db-event-meta{font-size:.78rem;color:var(--muted);}
@media(max-width:600px){
  .noa-stats-grid{grid-template-columns:1fr 1fr;}
  .noa-form-row{grid-template-columns:1fr;}
}

/* ── Messaging panel ──────────────────────────────────────────────────────── */
.msg-panel{
  position:fixed;
  top:66px;right:12px;
  width:min(380px,calc(100vw - 24px));
  max-height:75vh;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--ring);
  border-radius:18px;
  box-shadow:0 16px 40px rgba(17,24,39,.12);
  z-index:90;
  display:flex;
  flex-direction:column;
}
.msg-panel.hidden{display:none!important;}
.msg-panel-header{
  padding:14px 16px 10px;
  border-bottom:1px solid var(--ring);
  font-weight:700;
  font-size:.95rem;
  flex-shrink:0;
}
.conv-list{overflow-y:auto;flex:1;}
.conv-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  cursor:pointer;
  border:0;
  background:transparent;
  width:100%;
  text-align:left;
  transition:background .12s;
}
.conv-item:hover,.conv-item.active{background:var(--soft);}
.conv-item.conv-unread .conv-name{font-weight:900;color:var(--ink);}
.conv-meta{flex:1;min-width:0;}
.conv-name{font-size:.88rem;font-weight:700;display:block;}
.conv-preview{font-size:.78rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;}
.conv-time{font-size:.72rem;color:#9ca3af;flex-shrink:0;}
.conv-unread-dot{width:8px;height:8px;border-radius:50%;background:var(--brand);flex-shrink:0;}
/* Thread */
.msg-thread{display:flex;flex-direction:column;height:100%;min-height:0;}
.msg-thread-header{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-bottom:1px solid var(--ring);
  flex-shrink:0;
}
.msg-back-btn{
  background:none;border:0;cursor:pointer;
  color:var(--muted);padding:4px;border-radius:8px;
  display:flex;align-items:center;
}
.msg-back-btn:hover{background:#f3f4f6;color:var(--brand);}
.msg-bubbles{
  flex:1;overflow-y:auto;
  padding:12px 14px;
  display:flex;flex-direction:column;
  gap:6px;
  min-height:0;
  -webkit-overflow-scrolling:touch;
}
.msg-bubble{
  max-width:75%;
  padding:8px 12px;
  border-radius:16px;
  font-size:.88rem;
  line-height:1.4;
  word-break:break-word;
}
.msg-bubble.mine{
  background:var(--brand);color:#fff;
  border-bottom-right-radius:4px;
  align-self:flex-end;
}
.msg-bubble.theirs{
  background:#f3f4f6;color:var(--ink);
  border-bottom-left-radius:4px;
  align-self:flex-start;
}
.msg-bubble-time{font-size:.65rem;opacity:.65;margin-top:2px;display:block;}
.msg-input-row{
  display:flex;gap:8px;
  padding:10px 12px;
  border-top:1px solid var(--ring);
  flex-shrink:0;
}
.msg-input{
  flex:1;
  border:1px solid var(--ring);
  border-radius:999px;
  padding:8px 14px;
  font-size:.88rem;
  outline:none;
  resize:none;
  font-family:inherit;
  line-height:1.4;
  /* Override global textarea min-height */
  min-height:0;
  height:38px;
  max-height:120px;
  margin-top:0;
  overflow-y:auto;
}
.msg-input:focus{border-color:var(--brand);}
.msg-send-btn{
  background:var(--brand);color:#fff;
  border:0;border-radius:999px;
  padding:8px 16px;cursor:pointer;
  font-weight:700;font-size:.85rem;
  white-space:nowrap;
}
.msg-send-btn:hover{opacity:.9;}
.msg-empty{
  color:var(--muted);font-size:.88rem;
  text-align:center;padding:24px 16px;
}
/* Mobile: messages live inside #messagesView (normal page flow — no fixed, no z-index fights) */
.msg-page-card{
  display:flex;
  flex-direction:column;
  padding:0!important;
  margin:0!important;
  border-left:0!important;
  border-right:0!important;
  border-radius:0!important;
  overflow:hidden;
  /* nav(~52px) + quick-menu(~39px) + bottom-nav(60px) + safe-area(~34px) + buffer ≈ 195px */
  /* #messagesView padding stripped to 0 on mobile, so no extra offset needed */
  height:calc(100dvh - 195px - env(safe-area-inset-bottom, 0px));
  max-height:calc(100dvh - 195px - env(safe-area-inset-bottom, 0px));
  min-height:200px;
}
.msg-page-thread{
  /* Thread fills full card — use flex instead of height:100% for robustness */
  flex:1;
  min-height:0;
  overflow:hidden;
}
.msg-page-card .msg-thread{
  display:flex;
  flex-direction:column;
  height:100%;
  overflow:hidden;
}
.msg-page-card .msg-panel-header{
  padding:14px 16px 12px;
  border-bottom:1px solid var(--ring);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.msg-page-card .conv-list{
  flex:1;
  overflow-y:auto;
}
.msg-panel-close-btn{
  background:none;border:0;cursor:pointer;
  color:#9ca3af;font-size:1.15rem;line-height:1;
  padding:4px 6px;border-radius:8px;flex-shrink:0;
}
.msg-panel-close-btn:hover{background:#f3f4f6;color:var(--ink);}

/* Mobile-specific overrides for message thread */
@media (max-width:760px){
  /* Remove page-view padding so card fills edge-to-edge */
  #messagesView{
    padding:0!important;
    max-width:100%!important;
  }
  /* Compact input row — was too chunky */
  .msg-input-row{
    padding:6px 10px;
    gap:6px;
  }
  .msg-input{
    padding:6px 12px;
    font-size:.85rem;
    height:34px;
    max-height:72px;
    min-height:0;
    line-height:1.4;
  }
  .msg-send-btn{
    padding:0 14px;
    height:34px;
    font-size:.8rem;
    flex-shrink:0;
  }
}

/* ── User profile view ────────────────────────────────────────────────────── */
.user-profile-header{
  background:#fff;border:1px solid var(--ring);
  border-radius:18px;padding:24px 20px 20px;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  margin-bottom:16px;
}
.user-profile-avatar{
  width:86px;height:86px;border-radius:50%;
  font-size:2rem;font-weight:900;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,var(--brand),var(--purple));color:#fff;
  overflow:hidden;flex-shrink:0;
  box-shadow:0 8px 20px rgba(79,70,229,.22);
}
.user-profile-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%;}
.user-profile-name{font-size:1.25rem;font-weight:900;text-align:center;}
.user-profile-badges{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;}
.user-profile-level-pill{background:var(--brand);color:#fff;font-size:.75rem;font-weight:800;padding:3px 12px;border-radius:999px;}
.user-profile-nopis-pill{background:#fef3c7;color:#92400e;font-size:.75rem;font-weight:700;padding:3px 12px;border-radius:999px;display:inline-flex;align-items:center;gap:4px;}
.user-profile-stats{display:flex;gap:20px;margin-top:4px;}
.user-profile-stat{display:flex;flex-direction:column;align-items:center;gap:1px;}
.user-profile-stat strong{font-size:1.2rem;font-weight:900;color:var(--brand);}
.user-profile-stat span{font-size:.72rem;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em;}
.user-profile-meta{font-size:.78rem;color:var(--muted);text-align:center;line-height:1.7;}
.user-profile-actions{display:flex;gap:8px;margin-top:6px;}
.user-profile-msg-btn{
  background:var(--brand);color:#fff;border:0;border-radius:999px;
  padding:9px 22px;cursor:pointer;font-weight:700;font-size:.9rem;
  display:flex;align-items:center;gap:6px;
}
.user-profile-msg-btn:hover{opacity:.88;}
.user-profile-back-btn{
  display:flex;align-items:center;gap:6px;
  background:none;border:0;cursor:pointer;
  color:var(--muted);font-size:.85rem;font-weight:700;
  padding:0 0 12px 0;
}
.user-profile-back-btn:hover{color:var(--brand);}
.user-profile-posts-label{
  font-size:.75rem;font-weight:900;text-transform:uppercase;
  letter-spacing:.07em;color:var(--muted);margin-bottom:8px;
}
.user-profile-post-card{
  background:#fff;border:1px solid var(--ring);
  border-radius:14px;padding:14px 16px;
  cursor:pointer;transition:box-shadow .15s;margin-bottom:8px;
}
.user-profile-post-card:hover{box-shadow:0 4px 16px rgba(79,70,229,.10);}
.user-profile-post-title{font-size:.95rem;font-weight:700;margin-bottom:4px;}
.user-profile-post-meta{font-size:.75rem;color:var(--muted);display:flex;gap:10px;flex-wrap:wrap;}

/* Contribution cards (posts + comments with nopis earned) */
.contrib-card{background:#fff;border:1px solid var(--ring);border-radius:14px;padding:12px 14px;cursor:pointer;transition:box-shadow .15s;margin-bottom:8px;display:flex;flex-direction:column;gap:4px;}
.contrib-card:hover{box-shadow:0 4px 14px rgba(79,70,229,.10);}
.contrib-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}
.contrib-card-text{flex:1;min-width:0;}
.contrib-type-badge{display:inline-flex;align-items:center;gap:4px;font-size:.68rem;font-weight:900;text-transform:uppercase;letter-spacing:.06em;padding:.2rem .55rem;border-radius:999px;flex-shrink:0;margin-top:1px;}
.contrib-type-badge.post-badge{background:#eef2ff;color:var(--brand);}
.contrib-type-badge.comment-badge{background:#f0fdf4;color:#15803d;}
.contrib-card-title{font-size:.9rem;font-weight:700;line-height:1.3;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.contrib-card-excerpt{font-size:.8rem;color:var(--muted);line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.contrib-card-meta{display:flex;align-items:center;gap:8px;font-size:.74rem;color:var(--muted);flex-wrap:wrap;}
.contrib-nopis-earned{display:inline-flex;align-items:center;gap:3px;background:#fffbeb;border:1px solid #fde68a;color:#92400e;border-radius:999px;padding:.15rem .55rem;font-size:.74rem;font-weight:800;}
.contrib-nopis-earned.gifted{background:#faf5ff;border-color:#e9d5ff;color:#6d28d9;}
.contrib-empty{color:var(--muted);font-size:.88rem;padding:16px 0;}
/* Admin gift nopis */
.gift-nopis-btn{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;color:#d97706;font-weight:900;font-size:.88rem;padding:0;cursor:pointer;transition:opacity .15s;}
.gift-nopis-btn:hover{opacity:.7;}
.gift-nopis-inline{display:flex;align-items:center;gap:6px;background:#fffbeb;border:1px solid #fde68a;border-radius:12px;padding:5px 8px;margin-top:6px;flex-wrap:wrap;}
.gift-nopis-presets{display:flex;gap:4px;flex-wrap:wrap;}
.gift-nopis-preset{border:1px solid #fde68a;background:#fff;color:#92400e;font-weight:800;font-size:.78rem;border-radius:8px;padding:3px 9px;cursor:pointer;transition:background .12s;}
.gift-nopis-preset:hover,.gift-nopis-preset.selected{background:#fef3c7;}
.gift-nopis-custom-input{width:54px;border:1px solid #fde68a;border-radius:8px;padding:3px 7px;font-size:.82rem;font-weight:700;text-align:center;outline:none;background:#fff;}
.gift-nopis-custom-input:focus{border-color:#f59e0b;}
.gift-nopis-confirm-btn{background:#f59e0b;color:#fff;border:0;border-radius:8px;padding:4px 12px;font-size:.8rem;font-weight:900;cursor:pointer;white-space:nowrap;}
.gift-nopis-confirm-btn:hover{background:#d97706;}
.gift-nopis-success{font-size:.8rem;font-weight:800;color:#15803d;display:flex;align-items:center;gap:4px;}

/* Noa teacher label — inline pill next to author name */
.noa-label-inline{
  display:inline-flex;align-items:center;gap:3px;
  border-radius:999px;padding:.18rem .55rem;
  margin-left:6px;vertical-align:middle;
  font-size:.68rem;font-weight:800;white-space:nowrap;
  line-height:1;
}
.noa-label-inline.label-needs-work{background:#fff7ed;color:#c2410c;}
.noa-label-inline.label-amazing{background:#faf5ff;color:#6d28d9;}
.noa-label-inline.label-native{background:#fffbeb;color:#92400e;}
/* Label pickers in gift form */
.gift-label-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:4px;width:100%;}
.gift-label-btn{
  border:1.5px solid #e5e7eb;background:#fff;
  color:#374151;font-weight:800;font-size:.78rem;
  border-radius:10px;padding:5px 11px;cursor:pointer;
  transition:all .12s;white-space:nowrap;
}
.gift-label-btn:hover{border-color:#c4b5fd;color:#6d28d9;background:#faf5ff;}
.gift-label-btn.selected-needs-work{border-color:#fed7aa;background:#fff7ed;color:#c2410c;}
.gift-label-btn.selected-amazing{border-color:#ddd6fe;background:#faf5ff;color:#6d28d9;}
.gift-label-btn.selected-native{border-color:#fde68a;background:#fffbeb;color:#92400e;}

/* ── Profile card overlay ─────────────────────────────────────────────────── */
.profile-card-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.45);
  z-index:1600;
  display:flex;align-items:center;justify-content:center;
  padding:16px;
}
.profile-card-overlay.hidden{display:none!important;}
.profile-card{
  background:#fff;
  border-radius:24px;
  padding:28px 24px 22px;
  width:min(320px,100%);
  box-shadow:0 24px 60px rgba(17,24,39,.18);
  display:flex;flex-direction:column;align-items:center;gap:10px;
  position:relative;
}
.profile-card-close{
  position:absolute;top:12px;right:14px;
  background:none;border:0;cursor:pointer;
  color:#9ca3af;font-size:1.2rem;line-height:1;
  padding:4px 6px;border-radius:8px;
}
.profile-card-close:hover{background:#f3f4f6;color:var(--ink);}
.profile-card-avatar{width:72px;height:72px;border-radius:50%;font-size:1.6rem;font-weight:900;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--brand),var(--purple));color:#fff;overflow:hidden;flex-shrink:0;}
.profile-card-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%;}
.profile-card-name{font-size:1.1rem;font-weight:800;text-align:center;}
.profile-card-badges{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-top:2px;}
.profile-card-level-pill{
  background:var(--brand);color:#fff;
  font-size:.75rem;font-weight:800;
  padding:3px 10px;border-radius:999px;
}
.profile-card-nopis-pill{
  background:#fef3c7;color:#92400e;
  font-size:.75rem;font-weight:700;
  padding:3px 10px;border-radius:999px;
  display:inline-flex;align-items:center;gap:4px;
}
.profile-card-meta{
  display:flex;flex-direction:column;align-items:center;gap:3px;
  margin-top:4px;
}
.profile-card-meta-item{font-size:.78rem;color:var(--muted);}
.profile-card-contributions{
  font-size:.78rem;font-weight:700;color:var(--brand);
  margin-top:4px;
}
.profile-card-actions{display:flex;gap:8px;margin-top:10px;width:100%;}
.profile-card-view-btn,
.profile-card-msg-btn{
  flex:1;
  border:0;border-radius:999px;
  padding:9px 14px;cursor:pointer;
  font-weight:700;font-size:.83rem;
  display:flex;align-items:center;justify-content:center;gap:5px;
}
.profile-card-view-btn{
  background:#f3f4f6;color:var(--ink);
  border:1px solid var(--ring);
}
.profile-card-view-btn:hover{background:#e5e7eb;}
.profile-card-msg-btn{
  background:var(--brand);color:#fff;
}
.profile-card-msg-btn:hover{opacity:.88;}

.profile-avatar-panel{
  display:grid;
  justify-items:center;
  gap:10px;
}
.profile-photo{
  width:104px;
  height:104px;
  border-radius:999px;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  font-weight:900;
  font-size:2.4rem;
  overflow:hidden;
  box-shadow:0 14px 26px rgba(79,70,229,.18);
}
.avatar-upload-btn{
  padding:.62rem .9rem!important;
  border-radius:999px!important;
}
.profile-avatar-status{
  min-height:1.1em;
  text-align:center;
  margin:0!important;
}
@media (max-width:760px){
  .profile-photo{width:88px;height:88px;font-size:2rem;}
  .profile-avatar-panel{gap:8px;}
  .profile-avatar-wrap{width:104px;height:104px;padding:6px;}
  .profile-avatar-wrap .profile-photo{width:92px!important;height:92px!important;}
}

/* Inter design refresh */
:root{
  --ui-font: Inter, "Helvetica Neue", Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: Poppins, Inter, "Helvetica Neue", Arial, sans-serif;
}
body,
input,
textarea,
select,
button,
.comment-content,
.post-content,
.voice-text,
.muted,
.small,
.author-copy,
.comment-author-line,
.category,
.quick-link,
.icon-action,
.comment-like-btn{
  font-family:var(--ui-font)!important;
  font-weight:500;
  letter-spacing:-.01em;
}
h1,h2,h3,.brand,.logo,.post h2,.detail-post-card h1,.page-intro h1,.section-heading h2{
  font-family:var(--display-font)!important;
  letter-spacing:-.035em;
}
.post-content,
.comment-content,
.voice-text{
  font-weight:500!important;
}
.author-copy strong,
.comment-author-line strong{
  font-weight:700!important;
}
.muted,.small,.author-copy span,.comment-author-line span{
  font-weight:500!important;
}
.primary-btn,.secondary-btn,.join-btn,.ghost-btn{
  font-weight:700!important;
}
.google-auth-button{
  display:flex;
  justify-content:center;
  min-height:44px;
  margin:.35rem 0 .2rem;
}
.auth-divider{
  display:flex;
  align-items:center;
  gap:12px;
  color:#9ca3af;
  font-size:.82rem;
  font-weight:600;
  margin:.45rem 0 .35rem;
}
.auth-divider::before,
.auth-divider::after{
  content:"";
  height:1px;
  flex:1;
  background:#e5e7eb;
}
.google-disabled{
  text-align:center;
  margin:.2rem 0!important;
}

/* Subscription modal */
.subscription-modal{
  position:fixed;
  top:55px;left:0;right:0;bottom:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(17,24,39,.58);
  animation:subscriptionFadeIn .22s ease-out;
}
.subscription-modal.hidden{
  display:none!important;
}
.subscription-dialog{
  position:relative;
  width:min(100%,820px);
  max-height:calc(100dvh - 55px - 28px);
  overflow:auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,.8fr);
  gap:22px;
  background:linear-gradient(180deg,#fffaf2 0%,#f8fbff 100%);
  border:1px solid rgba(17,24,39,.08);
  border-radius:8px;
  box-shadow:0 30px 90px rgba(17,24,39,.28);
  padding:28px;
  font-family:Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif!important;
  animation:subscriptionDialogIn .28s cubic-bezier(.2,.8,.2,1);
}
.subscription-dialog>#closeSubscriptionModal{
  z-index:5;
  top:10px;
  right:10px;
  box-shadow:0 10px 26px rgba(17,24,39,.16);
}
.subscription-copy{
  display:grid;
  align-content:center;
  min-width:0;
  padding-right:8px;
}
.subscription-copy h2{
  margin:0 0 14px;
  max-width:520px;
  color:#4f2fbd;
  font-family:Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif!important;
  font-size:2.22rem;
  line-height:1.08;
  font-weight:800;
  letter-spacing:0!important;
}
.subscription-copy h2 span{
  display:inline-block;
  color:#3f229f;
  animation:titleYouFloat 3.8s ease-in-out infinite;
  transform-origin:center;
}
.subscription-lead{
  max-width:520px;
  margin:0;
  color:#374151;
  font-size:1rem;
  line-height:1.65;
  font-weight:600;
}
.subscription-lead-tight{
  margin-top:14px;
  color:#4f2fbd;
  font-weight:800;
}
.subscription-value-list{
  display:grid;
  gap:7px;
  margin:8px 0 0;
  padding:0;
  list-style:none;
}
.subscription-value-list li{
  position:relative;
  padding-left:18px;
  color:#1f2937;
  font-size:.98rem;
  font-weight:700;
  line-height:1.35;
}
.subscription-value-list li::before{
  content:"-";
  position:absolute;
  left:0;
  color:#4f2fbd;
  font-weight:900;
}
.subscription-signoff{
  margin:18px 0 0;
  color:#4f2fbd;
  font-size:1.05rem;
  font-style:italic;
  font-weight:900;
  text-align:center;
}
.subscription-signoff span{
  display:inline-block;
  margin-left:6px;
  color:#3f229f;
}
.subscription-actions{
  display:grid;
  gap:12px;
  margin-top:22px;
}
.subscription-main-btn,
.subscription-login-btn{
  min-height:50px;
  padding-inline:22px!important;
}
.subscription-price-card{
  position:relative;
  overflow:hidden;
  background:#fff;
  border:1px solid rgba(17,24,39,.08);
  border-radius:8px;
  box-shadow:0 18px 48px rgba(17,24,39,.1);
  padding:22px;
}
.subscription-price-card>*:not(.price-kana){
  position:relative;
  z-index:1;
}
.price-kana{
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
}
.price-kana span{
  position:absolute;
  left:var(--left,50%);
  bottom:-18%;
  color:#6d4aff;
  font-weight:900;
  font-size:var(--s, .9rem);
  line-height:1;
  opacity:0;
  will-change:transform,opacity;
  animation:kanaFloat var(--d, 12s) linear var(--delay, 0s) infinite;
}
.price-row{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:6px;
  margin:8px 0 4px;
}
.price-row span{
  color:transparent;
  background:linear-gradient(110deg,#6d4aff 0%,#b66cff 24%,#f5c45e 48%,#fff1a8 60%,#7c3aed 82%,#6d4aff 100%);
  background-size:260% 100%;
  -webkit-background-clip:text;
  background-clip:text;
  font-size:3.35rem;
  line-height:1;
  font-weight:900;
  letter-spacing:0;
  animation:subscriptionGradientShift 4.5s ease-in-out infinite;
}
.price-row small{
  color:#6b7280;
  font-weight:800;
  padding-bottom:6px;
}
.price-pressure{
  margin:8px 0 10px;
  padding:8px 10px;
  border-radius:8px;
  background:#f5f3ff;
  color:#5b21b6;
  font-size:.84rem;
  font-weight:900;
  line-height:1.35;
  text-align:center;
}
.subscription-price-card>.muted{
  text-align:center;
}
.subscription-benefits{
  display:grid;
  gap:10px;
  margin:20px 0 0;
  padding:0;
  list-style:none;
}
.subscription-benefits li{
  position:relative;
  padding:10px 12px 10px 34px;
  border:1px solid rgba(109,74,255,.1);
  border-radius:8px;
  background:#fff;
  color:#1f2937;
  font-weight:700;
  line-height:1.45;
}
.subscription-benefits li::before{
  content:"";
  position:absolute;
  left:13px;
  top:50%;
  width:8px;
  height:8px;
  border-radius:999px;
  background:#6d4aff;
  transform:translateY(-50%);
  box-shadow:0 0 0 5px rgba(109,74,255,.1);
}
.subscription-benefits li.featured-benefit{
  color:#111827;
  border-color:rgba(245,196,94,.48);
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(110deg,#6d4aff,#b66cff,#f5c45e,#fff1a8,#6d4aff) border-box;
  background-size:auto,260% 100%;
  border:1.5px solid transparent;
  box-shadow:0 12px 26px rgba(109,74,255,.1);
  animation:subscriptionBorderShift 5s ease-in-out infinite;
}
.subscription-benefits li.featured-benefit::before{
  width:10px;
  height:10px;
  background:linear-gradient(135deg,#6d4aff,#f5c45e);
  box-shadow:0 0 0 5px rgba(245,196,94,.18);
}
@keyframes subscriptionFadeIn{
  from{opacity:0;}
  to{opacity:1;}
}
@keyframes subscriptionDialogIn{
  from{opacity:0;transform:translateY(14px) scale(.98);}
  to{opacity:1;transform:translateY(0) scale(1);}
}
@keyframes subscriptionGradientShift{
  0%,100%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
}
@keyframes subscriptionBorderShift{
  0%,100%{background-position:0 0,0% 50%;}
  50%{background-position:0 0,100% 50%;}
}
@keyframes titleYouFloat{
  0%,100%{transform:translateY(0) scale(1);}
  45%{transform:translateY(-4px) scale(1.08);}
  65%{transform:translateY(-2px) scale(1.04);}
}
@keyframes kanaFloat{
  0%{transform:translate3d(0,0,0) rotate(-4deg);opacity:0;}
  12%{opacity:var(--o,.1);}
  86%{opacity:var(--o,.1);}
  100%{transform:translate3d(var(--drift, 0),-62vh,0) rotate(7deg);opacity:0;}
}
@media (max-width:860px){
  .subscription-dialog{
    grid-template-columns:1fr;
    gap:14px;
    padding:20px;
  }
  .subscription-copy{
    padding:0;
  }
  .subscription-copy h2{
    margin-right:34px;
    font-size:1.85rem;
    line-height:1;
  }
  .subscription-lead{
    font-size:1rem;
    line-height:1.65;
  }
  .subscription-actions{
    margin-top:18px;
  }
  .subscription-price-card{
    padding:18px;
  }
  .price-row span{
    font-size:2.75rem;
  }
}

/* Premium onboarding subscription flow */
.subscription-dialog{
  width:min(100%,980px);
  overflow:hidden;
  display:block;
  grid-template-columns:none;
  gap:0;
  padding:0;
  border:1px solid rgba(109,74,255,.16);
  border-radius:24px;
  background:
    radial-gradient(circle at 12% 15%, rgba(245,196,94,.2), transparent 30%),
    radial-gradient(circle at 84% 10%, rgba(109,74,255,.18), transparent 32%),
    linear-gradient(135deg,#fff 0%,#fbfaff 52%,#f6f8ff 100%);
  box-shadow:0 34px 110px rgba(17,24,39,.32);
}
.subscription-dialog>#closeSubscriptionModal{
  top:14px;
  right:14px;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(109,74,255,.12);
}
.onboarding-shell{
  position:relative;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  min-height:640px;
  padding:20px;
}
.onboarding-shell::before{
  content:"学";
  position:absolute;
  right:-24px;
  top:50px;
  color:rgba(109,74,255,.055);
  font-size:20rem;
  line-height:1;
  font-weight:900;
  pointer-events:none;
}
.onboarding-progress{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  margin:0 48px 14px 0;
}
.onboarding-progress-track{
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:#ede9fe;
  box-shadow:inset 0 0 0 1px rgba(109,74,255,.08);
}
#onboardingProgressFill{
  display:block;
  width:25%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#4f46e5 0%,#7c3aed 58%,#f5c45e 100%);
  box-shadow:0 0 18px rgba(124,58,237,.34);
  transition:width .28s ease;
}
#onboardingStepLabel{
  color:#6b7280;
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.08em;
}
.onboarding-slides{
  position:relative;
  z-index:1;
  min-height:520px;
}
.onboarding-slide{
  display:none;
  grid-template-columns:minmax(0,1fr) minmax(280px,.92fr);
  align-items:center;
  gap:26px;
  min-height:520px;
}
.onboarding-slide.active{
  display:grid;
  animation:onboardingSlideIn .32s cubic-bezier(.2,.8,.2,1);
}
.onboarding-copy{
  min-width:0;
  padding:16px 6px 16px 8px;
}
.onboarding-kicker{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  margin-bottom:14px;
  padding:6px 11px;
  border:1px solid rgba(245,196,94,.42);
  border-radius:999px;
  background:rgba(255,255,255,.78);
  color:#5b21b6;
  font-size:.76rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  box-shadow:0 12px 28px rgba(109,74,255,.08);
}
.onboarding-copy h2{
  margin:0;
  max-width:570px;
  color:#111827;
  font-family:Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif!important;
  font-size:clamp(2.1rem, 4.7vw, 4.2rem);
  line-height:.98;
  font-weight:950;
  letter-spacing:0!important;
}
.onboarding-copy p{
  max-width:530px;
  margin:18px 0 0;
  color:#374151;
  font-size:1.02rem;
  line-height:1.6;
  font-weight:700;
}
.onboarding-pills,
.onboarding-metric-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:24px;
}
.onboarding-pills span,
.onboarding-metric-row span{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:9px 13px;
  border:1px solid rgba(109,74,255,.13);
  border-radius:999px;
  background:rgba(255,255,255,.82);
  color:#312e81;
  font-size:.9rem;
  font-weight:900;
  box-shadow:0 12px 28px rgba(109,74,255,.08);
}
.onboarding-feature-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:24px;
  max-width:560px;
}
.onboarding-feature-grid span{
  min-height:54px;
  padding:13px 14px;
  border:1px solid rgba(109,74,255,.13);
  border-radius:14px;
  background:rgba(255,255,255,.84);
  color:#111827;
  font-weight:900;
  line-height:1.25;
  box-shadow:0 12px 32px rgba(109,74,255,.08);
}
.onboarding-visual{
  justify-self:center;
  width:min(100%,340px);
  height:min(520px,64dvh);
  min-height:360px;
  position:relative;
}
.onboarding-visual::after{
  content:"";
  position:absolute;
  inset:auto 9% 4% 9%;
  height:34px;
  border-radius:999px;
  background:rgba(109,74,255,.18);
  filter:blur(18px);
  z-index:-1;
}
.onboarding-visual img{
  width:100%;
  height:100%;
  object-fit:contain;
  filter:drop-shadow(0 22px 34px rgba(79,70,229,.16));
}
.onboarding-price-card{
  max-width:520px;
  margin-top:24px;
  padding:18px;
  border:1px solid rgba(109,74,255,.14);
  border-radius:18px;
  background:rgba(255,255,255,.86);
  box-shadow:0 20px 46px rgba(17,24,39,.1);
}
.onboarding-price{
  display:flex;
  align-items:flex-end;
  gap:10px;
}
.onboarding-price span{
  color:transparent;
  background:linear-gradient(110deg,#111827 0%,#4f46e5 38%,#9d4edd 68%,#f5c45e 100%);
  -webkit-background-clip:text;
  background-clip:text;
  font-size:3.35rem;
  line-height:1;
  font-weight:950;
}
.onboarding-price small{
  padding-bottom:7px;
  color:#6b7280;
  font-weight:900;
}
.onboarding-price-card>p{
  margin:10px 0 0;
  color:#4b5563;
  font-size:.94rem;
}
.onboarding-footer{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  padding-top:16px;
}
.onboarding-dots{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
}
.onboarding-dot{
  appearance:none;
  width:9px;
  height:9px;
  padding:0;
  border:0;
  border-radius:999px;
  background:#c4b5fd;
  cursor:pointer;
  transition:width .2s ease, background .2s ease, box-shadow .2s ease;
}
.onboarding-dot.active{
  width:30px;
  background:linear-gradient(90deg,#4f46e5,#9d4edd);
  box-shadow:0 0 18px rgba(124,58,237,.32);
}
.onboarding-back-btn,
.onboarding-next-btn{
  min-width:132px;
  min-height:46px;
  padding-inline:18px!important;
  white-space:nowrap;
}
.onboarding-back-btn[disabled]{
  opacity:.35;
  cursor:default;
  pointer-events:none;
}
@keyframes onboardingSlideIn{
  from{opacity:0;transform:translateY(10px) scale(.99);}
  to{opacity:1;transform:translateY(0) scale(1);}
}
@media (max-width:860px){
  .subscription-dialog{
    width:min(100%,520px);
    max-height:calc(100dvh - 53px - 18px);
    overflow:auto;
    border-radius:18px;
  }
  .onboarding-shell{
    min-height:0;
    padding:16px;
  }
  .onboarding-shell::before{
    right:-34px;
    top:92px;
    font-size:12rem;
  }
  .onboarding-progress{
    margin-right:42px;
    margin-bottom:10px;
  }
  .onboarding-slides,
  .onboarding-slide{
    min-height:0;
  }
  .onboarding-slide,
  .onboarding-slide.active{
    grid-template-columns:1fr;
    gap:10px;
  }
  .onboarding-copy{
    padding:4px 0 0;
  }
  .onboarding-copy h2{
    font-size:clamp(1.9rem, 11vw, 3rem);
    line-height:1;
  }
  .onboarding-copy p{
    margin-top:12px;
    font-size:.94rem;
    line-height:1.48;
  }
  .onboarding-pills,
  .onboarding-metric-row{
    margin-top:16px;
    gap:8px;
  }
  .onboarding-pills span,
  .onboarding-metric-row span{
    min-height:34px;
    padding:8px 11px;
    font-size:.82rem;
  }
  .onboarding-feature-grid{
    grid-template-columns:1fr;
    gap:8px;
    margin-top:16px;
  }
  .onboarding-feature-grid span{
    min-height:44px;
    padding:11px 12px;
  }
  .onboarding-visual{
    width:min(100%,260px);
    height:270px;
    min-height:270px;
    order:-1;
  }
  .onboarding-price-card{
    margin-top:16px;
    padding:14px;
    border-radius:14px;
  }
  .onboarding-price span{
    font-size:2.55rem;
  }
  .onboarding-footer{
    grid-template-columns:1fr 1fr;
    gap:10px;
    padding-top:12px;
  }
  .onboarding-dots{
    grid-column:1 / -1;
    grid-row:1;
  }
  .onboarding-back-btn,
  .onboarding-next-btn{
    grid-row:2;
    min-width:0;
    width:100%;
  }
}


/* Admin pin/comment moderation */
.post-badges{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.pinned-badge{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border-radius:999px;background:#f5f3ff;border:1px solid #c4b5fd;color:#6d4aff;font-size:.78rem;font-weight:700;}
.pin-post-btn{color:#6b7280!important;opacity:.78;}
.pin-post-btn:hover,.pin-post-btn.is-pinned{color:#6d4aff!important;background:#f5f3ff!important;opacity:1;}
.admin-post .pin-post-btn.is-pinned{background:#fff7ed!important;color:#b45309!important;}
.comment-delete-btn{appearance:none;border:0;background:transparent;color:#9ca3af;font-size:.95rem;line-height:1;cursor:pointer;padding:4px 6px;border-radius:8px;opacity:.75;}
.comment-delete-btn:hover{color:#dc2626;background:#fee2e2;opacity:1;}
.comment-actions-row,.compact-comment-actions{align-items:center;}
@media (max-width:760px){
  .post-badges{justify-content:flex-start;gap:6px;}
  .pinned-badge{font-size:.72rem;padding:4px 8px;}
}

/* Globe + country update */
.monthly-prizes{
  margin:18px 0 20px;
  padding:16px 18px;
  background:linear-gradient(135deg,#fffbf0 0%,#fff5f9 100%);
  border:1.5px solid #f9d97a;
  border-radius:16px;
}
.monthly-prizes-title{
  margin:0 0 12px;
  font-size:.95rem;
  font-weight:900;
  letter-spacing:-.01em;
}
.prize-list{display:flex;flex-direction:column;gap:8px;}
.prize-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  background:#fff;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.06);
}
.prize-medal{font-size:1.4rem;line-height:1;flex-shrink:0;}
.prize-copy{display:flex;flex-direction:column;gap:1px;}
.prize-copy strong{font-size:.9rem;font-weight:800;color:var(--text,#1a1a1a);}
.prize-copy span{font-size:.8rem;color:var(--muted,#777);font-weight:500;}
.leaderboard-subtitle{
  margin:18px 0 10px;
  font-size:.84rem;
  font-weight:900;
  letter-spacing:.02em;
  color:var(--muted);
  text-transform:uppercase;
}
.globe-card{
  margin-top:18px;
  padding:18px;
  border:1px solid rgba(124,58,237,.14);
  border-radius:24px;
  background:#ffffff;
  color:var(--ink);
  box-shadow:0 18px 40px rgba(15,23,42,.06);
}
.globe-copy{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.globe-copy h2{
  margin:0;
  font-size:1.25rem;
  letter-spacing:-.03em;
}
.globe-copy .muted{color:var(--muted)!important;}
.globe-meta{
  flex:0 0 auto;
  align-self:flex-start;
  padding:8px 12px;
  border-radius:999px;
  background:#f6f1ff;
  border:1px solid rgba(124,58,237,.12);
  color:var(--brand-dark);
  font-weight:800;
  font-size:.83rem;
  white-space:nowrap;
}
.globe-stage{
  position:relative;
  width:100%;
  aspect-ratio:1/1;
  max-width:560px;
  margin:0 auto;
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff 0%, #f8fafc 100%);
}
.globe-canvas{
  width:100%;
  height:100%;
  display:block;
  touch-action:none;
  cursor:grab;
  overscroll-behavior:contain;
  -webkit-user-select:none;
  user-select:none;
}
.globe-canvas:active{cursor:grabbing;}
.leader-name-wrap{min-width:0;}
.leader-country{
  margin-top:2px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.profile-country-card{
  margin-top:12px;
  padding:14px;
  border:1px solid var(--ring);
  border-radius:18px;
  background:#fafaff;
}
.profile-country-card label{
  display:block;
  margin-bottom:8px;
  font-size:.82rem;
  font-weight:900;
  color:var(--brand-dark);
}
.profile-country-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
}
@media (max-width:760px){
  .globe-card{padding:14px;border-radius:20px;}
  .globe-copy{display:block;}
  .globe-meta{display:inline-flex;margin-top:10px;}
  .globe-stage{max-width:100%;min-height:320px;}
  .profile-country-row{grid-template-columns:1fr;}
  .leader-country{font-size:.72rem;}
}

/* Real map globe rendering */
.real-globe-ocean{fill:#ffffff;stroke:#d8d5e8;stroke-width:1.5;}
.real-globe-countries path{fill:#7c3aed;fill-opacity:.88;stroke:#5b21b6;stroke-width:.35;vector-effect:non-scaling-stroke;}
.real-globe-rim{fill:none;stroke:#c4b5fd;stroke-width:1.5;opacity:.75;}
.real-globe-dot-halo{fill:#8b5cf6;opacity:.20;}
.real-globe-count-badge{fill:#fff;stroke:#7c3aed;stroke-width:2.25;filter:url(#member-dot-glow);}
.real-globe-count-text{fill:#4c1d95;font-family:Inter,system-ui,sans-serif;font-size:12px;font-weight:900;text-anchor:middle;pointer-events:none;}
.globe-map-error{display:grid;place-items:center;min-height:280px;border-radius:24px;background:#f8fafc;color:var(--muted);font-weight:700;text-align:center;padding:24px;}

/* Mobile globe touch fix */
.globe-card,
.globe-stage,
.globe-canvas{
  touch-action:none!important;
  overscroll-behavior:contain!important;
  -webkit-user-select:none!important;
  user-select:none!important;
  -webkit-tap-highlight-color:transparent;
}

/* Globe interaction/readability fix */
.globe-stage{
  touch-action:none!important;
  overscroll-behavior:contain!important;
  -webkit-user-select:none!important;
  user-select:none!important;
  cursor:grab;
}
.globe-stage:active{cursor:grabbing;}
.real-globe-touch-capture{fill:transparent;pointer-events:all;}
.real-globe-countries path{fill:#7c3aed;fill-opacity:.9;stroke:#5b21b6;stroke-width:.28;vector-effect:non-scaling-stroke;}
.real-globe-ocean{fill:#ffffff;stroke:#d8d5e8;stroke-width:1.5;}
.real-globe-rim{fill:none;stroke:#c4b5fd;stroke-width:1.5;opacity:.65;}
.real-globe-badge-connector{stroke:#7c3aed;stroke-width:1.25;opacity:.55;stroke-linecap:round;}
.real-globe-anchor-dot{fill:#7c3aed;opacity:.72;}
@media (max-width:760px){
  .globe-canvas{min-height:330px;}
}

/* Globe zoom controls */
.globe-zoom-controls{
  position:absolute;
  inset:0;
  pointer-events:none!important;
  z-index:6;
}
.globe-zoom-btn{
  position:absolute;
  appearance:none;
  border:1px solid rgba(124,58,237,.18);
  width:44px;
  height:44px;
  border-radius:999px;
  background:rgba(255,255,255,.96);
  color:#4c1d95;
  font-weight:900;
  font-size:1.35rem;
  line-height:1;
  display:grid;
  place-items:center;
  box-shadow:0 10px 24px rgba(17,24,39,.12);
  pointer-events:auto!important;
  touch-action:manipulation!important;
  user-select:none;
  -webkit-user-select:none;
}
.globe-zoom-btn:hover{background:#f6f1ff;}
.globe-zoom-btn-left{left:12px;top:50%;transform:translateY(-50%);}
.globe-zoom-btn-right{right:12px;top:50%;transform:translateY(-50%);}
.globe-zoom-btn-reset{left:50%;bottom:12px;transform:translateX(-50%);width:auto;min-width:78px;padding:0 16px;font-size:.92rem;}
@media (max-width:760px){
  .globe-zoom-btn{width:42px;height:42px;font-size:1.25rem;}
  .globe-zoom-btn-left{left:8px;}
  .globe-zoom-btn-right{right:8px;}
  .globe-zoom-btn-reset{bottom:8px;min-width:74px;padding:0 14px;font-size:.88rem;}
}


/* Avatar centering + plain category tags + simple heart likes */
.avatar,
.comment-avatar,
.profile-photo{
  overflow:hidden!important;
}
.avatar.image-avatar img,
.comment-avatar.image-avatar img,
.profile-photo.image-avatar img,
.composer-user-avatar.image-avatar img,
#userAvatar.image-avatar img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center center!important;
  display:block!important;
}

.post-badges{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  min-width:0!important;
  max-width:100%!important;
}
.category,
.category.admin-category,
.category.general-category{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:0!important;
  margin:0!important;
  color:var(--brand)!important;
  font-size:.82rem!important;
  font-weight:700!important;
  line-height:1.25!important;
  display:inline!important;
  white-space:normal!important;
  overflow:visible!important;
  max-width:none!important;
  text-align:right!important;
}
@media (max-width:760px){
  .post-badges{justify-content:flex-start!important;margin-top:8px!important;}
  .category,.category.admin-category,.category.general-category{font-size:.82rem!important;text-align:left!important;}
}

.heart-icon,
.comment-heart-icon{
  width:22px!important;
  height:22px!important;
  display:inline-grid!important;
  place-items:center!important;
  color:#667085!important;
  line-height:1!important;
}
.heart-svg{
  width:21px!important;
  height:21px!important;
  display:block!important;
  color:currentColor!important;
}
.icon-action.liked .heart-icon,
.comment-like-btn.liked .comment-heart-icon{
  color:#ef4444!important;
}
.icon-action.liked .icon-count,
.comment-like-btn.liked b{
  color:#ef4444!important;
}
.comment-like-btn span,
.comment-like-btn .comment-heart-icon{
  font-size:0!important;
}


/* Launch stability: feed pagination */
.load-more-wrap{display:flex;justify-content:center;padding:8px 0 20px;}
.load-more-wrap .secondary-btn{min-width:180px;}


/* Post audio composer + Cloudinary savings pass */
.composer-record-status{
  min-height:18px;
  margin-top:6px;
  font-size:.82rem;
  font-weight:700;
  color:var(--muted);
}
.expanded-composer .voice-preview-slot .voice-preview-card{
  margin-top:8px;
  max-width:520px;
}
.post-audio-player{
  margin-top:12px;
  margin-bottom:6px;
  max-width:560px;
}


/* Profile XP progress upgrade */
.profile-xp-card{
  margin-top:10px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(124,58,237,.14);
  background:linear-gradient(135deg,#ffffff,#faf7ff);
}
.profile-xp-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;}
.profile-xp-top strong{display:block;font-size:1.2rem;line-height:1.1;letter-spacing:-.03em;}
.profile-xp-top b{font-size:.95rem;color:var(--brand-dark);white-space:nowrap;}
.profile-tier-label{display:inline-flex;margin-bottom:4px;font-size:.72rem;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);}
.profile-xp-bar{height:12px;border-radius:999px;background:#eef2ff;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(17,24,39,.04);}
.profile-xp-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--tier-a),var(--tier-b));box-shadow:0 0 18px color-mix(in srgb, var(--tier-b) 45%, transparent);transition:width .4s ease;}
.profile-xp-card p{margin:9px 0 0!important;font-size:.86rem;color:var(--muted);font-weight:600;}
.profile-xp-card.tier-beginner{--tier-a:#60a5fa;--tier-b:#7c3aed;}
.profile-xp-card.tier-kita{--tier-a:#22c55e;--tier-b:#14b8a6;}
.profile-xp-card.tier-fuji{--tier-a:#f59e0b;--tier-b:#ec4899;}
.profile-xp-card.tier-advanced{--tier-a:#8b5cf6;--tier-b:#ef4444;}
.profile-xp-card.tier-master{--tier-a:#facc15;--tier-b:#a855f7;}

/* ── Profile page redesign ────────────────────────────────────────────────── */
.profile-main{
  max-width:580px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
  padding:20px 0 8px;
  width:100%;
}
.profile-avatar-section{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
.profile-identity{
  text-align:center;
}
.profile-identity h2{
  margin:0 0 10px;
  font-size:1.7rem;
  letter-spacing:-.04em;
}
.profile-identity-badges{
  display:flex;
  gap:8px;
  justify-content:center;
  flex-wrap:wrap;
  align-items:center;
}
.profile-level-badge{
  display:inline-flex;
  align-items:center;
  background:var(--soft);
  color:var(--brand);
  border:1px solid #e0e7ff;
  border-radius:999px;
  padding:.32rem .85rem;
  font-size:.78rem;
  font-weight:800;
}
/* Tier pill in profile identity */
.profile-identity .profile-tier-label{
  display:inline-flex;
  align-items:center;
  padding:.32rem .85rem;
  border-radius:999px;
  font-size:.78rem;
  font-weight:900;
  color:#fff;
  margin-bottom:0;
  background:var(--brand);
}
.profile-identity .profile-tier-label.tier-beginner{background:linear-gradient(90deg,#60a5fa,#7c3aed);}
.profile-identity .profile-tier-label.tier-kita{background:linear-gradient(90deg,#22c55e,#14b8a6);}
.profile-identity .profile-tier-label.tier-fuji{background:linear-gradient(90deg,#f59e0b,#ec4899);}
.profile-identity .profile-tier-label.tier-advanced{background:linear-gradient(90deg,#8b5cf6,#ef4444);}
.profile-identity .profile-tier-label.tier-master{background:linear-gradient(90deg,#facc15,#a855f7);}
/* Stats row */
.profile-stats-row{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  width:100%;
}
.pstat{
  background:var(--card);
  border:1px solid var(--ring);
  border-radius:16px;
  padding:12px 8px;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
}
.pstat strong{
  font-size:1.1rem;
  font-weight:900;
  color:var(--brand);
  line-height:1.15;
}
.pstat strong small{
  font-size:.65em;
  font-weight:700;
  color:var(--muted);
}
.pstat>span{
  font-size:.67rem;
  color:var(--muted);
  font-weight:700;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.03em;
}
/* Country + actions inside profile-main */
.profile-main .profile-country-card{
  margin-top:0;
  width:100%;
}
.profile-main .profile-actions{
  width:100%;
}
.profile-main .profile-actions button{
  width:100%;
}
/* 2-column stats on small screens */
@media(max-width:540px){
  .profile-stats-row{grid-template-columns:repeat(2,1fr);}
}

/* Leaderboard top 3 distinction */
.leader-line{position:relative;overflow:hidden;}
.leader-top-1{border:2px solid transparent!important;background:linear-gradient(#fff,#fff) padding-box,linear-gradient(120deg,#7c3aed,#ec4899,#60a5fa,#7c3aed) border-box!important;animation:topOneGlow 3.2s linear infinite;box-shadow:0 12px 28px rgba(124,58,237,.16)!important;}
.leader-top-1 .rank{background:linear-gradient(135deg,#7c3aed,#ec4899)!important;}
.leader-top-2{border:2px solid #facc15!important;background:linear-gradient(135deg,#fff,#fffbeb)!important;box-shadow:0 10px 24px rgba(250,204,21,.16)!important;}
.leader-top-2 .rank{background:linear-gradient(135deg,#f59e0b,#facc15)!important;color:#422006!important;}
.leader-top-3{border:2px solid #cbd5e1!important;background:linear-gradient(135deg,#fff,#f8fafc)!important;box-shadow:0 10px 24px rgba(148,163,184,.16)!important;}
.leader-top-3 .rank{background:linear-gradient(135deg,#94a3b8,#e2e8f0)!important;color:#1f2937!important;}
@keyframes topOneGlow{0%{filter:hue-rotate(0deg);}100%{filter:hue-rotate(360deg);}}
@media (prefers-reduced-motion:reduce){.leader-top-1{animation:none;}}

/* Calendar upgrade */
.calendar-heading-row{align-items:flex-start;}
.calendar-heading-row p{margin:.3rem 0 0;}
.calendar-month{align-items:center!important;display:grid!important;grid-template-columns:auto 1fr auto!important;}
.calendar-arrow{width:38px;height:38px;border-radius:999px;border:1px solid var(--ring);background:#fff;color:var(--brand-dark);font-size:1.5rem;font-weight:900;display:grid;place-items:center;box-shadow:0 6px 18px rgba(17,24,39,.05);}
.calendar-arrow:disabled{opacity:.35;cursor:not-allowed;}
.calendar-grid .day{appearance:none;text-align:left;color:var(--ink);cursor:default;}
.calendar-grid button.day{cursor:pointer;}
.calendar-grid button.day:hover{border-color:#c4b5fd;box-shadow:0 8px 18px rgba(124,58,237,.10);}
.calendar-event-row{width:100%;text-align:left;cursor:pointer;}
.calendar-event-modal{position:fixed;inset:0;z-index:1500;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(17,24,39,.55);}
.calendar-event-modal.hidden{display:none!important;}
.calendar-event-dialog{position:relative;width:min(100%,430px);background:#fff;border:1px solid var(--ring);border-radius:24px;box-shadow:0 28px 80px rgba(17,24,39,.28);padding:24px;}
.calendar-event-kicker{display:inline-flex;margin-bottom:10px;padding:5px 10px;border-radius:999px;background:#f5f3ff;color:var(--brand-dark);font-size:.78rem;font-weight:900;}
.calendar-event-dialog h2{margin:0 36px 8px 0;font-size:1.4rem;line-height:1.15;letter-spacing:-.03em;}
.calendar-event-dialog p{margin:.5rem 0;}
.calendar-event-info{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0;}
.calendar-event-info span{padding:7px 10px;border-radius:999px;background:#f8fafc;border:1px solid var(--ring);font-size:.82rem;font-weight:800;color:#374151;}
.calendar-join-btn{width:100%;margin-top:8px;}
@media (max-width:760px){.calendar-month{grid-template-columns:38px 1fr 38px!important;gap:8px;}.calendar-event-dialog{border-radius:20px;padding:20px;}.calendar-grid .day{min-height:54px;}}

/* Calendar + leaderboard mobile polish */
.leader-rank-avatar{
  position:relative;
  width:44px;
  height:44px;
  flex:0 0 auto;
}
.leader-rank-avatar .leader-avatar{
  width:44px;
  height:44px;
  border-radius:999px;
  overflow:hidden;
  display:grid;
  place-items:center;
  font-weight:900;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  color:#fff;
  border:2px solid #fff;
  box-shadow:0 8px 18px rgba(17,24,39,.12);
}
.leader-rank-avatar .leader-avatar img,
.leader-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center center;
  display:block;
}
.leader-position{
  position:absolute;
  right:-4px;
  bottom:-4px;
  z-index:2;
  min-width:18px;
  height:18px;
  padding:0 4px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#111827;
  color:#fff;
  border:2px solid #fff;
  font-size:.66rem;
  font-weight:900;
  line-height:1;
}
.leader-top-1 .leader-position{background:linear-gradient(135deg,#7c3aed,#ec4899);}
.leader-top-2 .leader-position{background:#d97706;}
.leader-top-3 .leader-position{background:#64748b;}

.calendar-grid{
  gap:7px!important;
}
.calendar-grid .day{
  min-height:64px;
  padding:8px!important;
  border-radius:16px!important;
  position:relative;
  justify-content:flex-start!important;
  gap:6px;
}
.calendar-grid .day.has-event{
  background:linear-gradient(135deg,var(--brand),#7c3aed)!important;
  color:#fff!important;
  border-color:transparent!important;
  box-shadow:0 10px 22px rgba(124,58,237,.22)!important;
}
.calendar-grid .day.has-event span:first-child{
  color:#fff!important;
}
/* Timezone note on the calendar page */
.calendar-tz-note{
  display:inline-flex;
  align-items:center;
  gap:4px;
  background:#fef3c7;
  color:#b45309;
  border:1px solid #fde68a;
  border-radius:999px;
  padding:5px 12px;
  font-size:.74rem;
  font-weight:800;
  margin:0 0 12px;
}

/* Event count bubble — unmistakable cue on any screen size */
.calendar-day-badge{
  position:absolute;
  top:4px;
  right:4px;
  min-width:19px;
  height:19px;
  padding:0 5px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:.68rem;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 2px 6px rgba(239,68,68,.45);
  z-index:2;
}
.calendar-event-marker{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  width:max-content;
  max-width:100%;
  padding:3px 6px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  color:#fff!important;
  border:1px solid rgba(255,255,255,.25);
  font-size:.58rem!important;
  line-height:1!important;
  font-weight:900!important;
  white-space:nowrap;
}
.calendar-event-row{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:14px!important;
  padding:14px!important;
  border-radius:22px!important;
}
.calendar-weekly-badge{
  width:70px!important;
  min-height:58px;
  display:grid;
  place-items:center;
  align-content:center;
  background:#f5f3ff!important;
  color:var(--brand-dark)!important;
}
.calendar-event-copy{min-width:0;}
.calendar-event-copy h3{
  margin:0 0 4px!important;
  font-size:1.02rem;
  line-height:1.15;
  color:var(--brand);
  overflow-wrap:anywhere;
}
.calendar-event-copy p{
  margin:0!important;
  line-height:1.35;
}
@media (max-width:760px){
  .leader-line{grid-template-columns:44px minmax(0,1fr) auto!important;}
  .leader-level{display:none;}
  .leader-rank-avatar,.leader-rank-avatar .leader-avatar{width:40px;height:40px;}
  .calendar-month{grid-template-columns:42px minmax(0,1fr) 42px!important;align-items:start!important;}
  .calendar-month h2{font-size:1.35rem!important;}
  .calendar-month p{font-size:.9rem!important;line-height:1.3;}
  .calendar-arrow{width:42px!important;height:42px!important;margin-top:2px;}
  .calendar-grid{gap:6px!important;}
  .calendar-grid .day{min-height:58px!important;padding:7px!important;border-radius:14px!important;font-size:.82rem!important;}
  .calendar-event-marker{font-size:.56rem!important;padding:3px 6px;}
  .calendar-event-row{padding:12px!important;gap:12px!important;border-radius:20px!important;}
  .calendar-weekly-badge{width:62px!important;min-height:54px;font-size:.8rem;}
  .calendar-event-copy h3{font-size:.98rem;}
  .calendar-event-copy p{font-size:.88rem;}
}
@media (max-width:390px){
  .calendar-event-marker{font-size:.48rem!important;padding:2px 4px;letter-spacing:-.02em;}
}


/* Calendar mobile dot interaction refinement */
.selected-calendar-events{margin-top:14px;}
.selected-calendar-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 8px;color:var(--muted);font-size:.82rem;font-weight:800;}
.selected-calendar-heading strong{color:var(--brand-dark);background:#f5f3ff;border:1px solid #ddd6fe;border-radius:999px;padding:5px 9px;font-size:.74rem;white-space:nowrap;}
.calendar-empty-events{padding:10px 2px;}
.calendar-grid .day.selected-day{border-color:#8b5cf6!important;box-shadow:0 0 0 3px rgba(139,92,246,.12)!important;}
.calendar-event-dot{display:none;}
@media (max-width:760px){
  /* Event days: solid theme purple with white day number */
  .calendar-grid .day.has-event{
    background:linear-gradient(135deg,var(--brand),#7c3aed)!important;
    color:#fff!important;
    border-color:transparent!important;
    box-shadow:0 6px 14px rgba(124,58,237,.25)!important;
  }
  .calendar-grid .day.has-event span:first-child{color:#fff!important;}
  .calendar-event-marker{display:none!important;}
  .calendar-grid .day.selected-day{
    background:#f5f3ff!important;
    border-color:#8b5cf6!important;
  }
  .calendar-grid .day.has-event.selected-day{
    background:linear-gradient(135deg,var(--brand),#7c3aed)!important;
    border-color:#fff!important;
  }
  .selected-calendar-heading{font-size:.78rem;}
}


/* Calendar click/list cleanup */
.calendar-heading-row p,
.calendar-month p{display:none!important;}
.calendar-empty-events{font-weight:800;color:var(--muted);background:#f8fafc;border:1px solid var(--ring);border-radius:18px;padding:14px 16px!important;margin:8px 0 0;}
@media (max-width:760px){
  .calendar-month{align-items:center!important;}
  .calendar-month h2{margin:0!important;}
  .calendar-grid button.day{touch-action:manipulation;}
}


/* Calendar title removal + mobile tap reliability */
.calendar-heading-compact{justify-content:flex-end;margin-bottom:4px;}
.calendar-grid .day,
.calendar-grid .day *{touch-action:manipulation;}
.calendar-grid .day .calendar-event-dot,
.calendar-grid .day .calendar-event-marker{pointer-events:none;}
@media (max-width:760px){
  .calendar-heading-compact{min-height:0;margin-bottom:2px;}
  .calendar-grid .day{position:relative;pointer-events:auto;-webkit-tap-highlight-color:transparent;}
}


/* Interaction smoothness pass */
:root{
  --tap-ease:cubic-bezier(.2,.8,.2,1);
  --tap-shadow:0 10px 24px rgba(17,24,39,.08);
  --tap-shadow-strong:0 14px 30px rgba(79,70,229,.20);
}
html{
  scroll-behavior:smooth;
}
button,
[role="button"],
.post,
.calendar-event-row,
.image-attachment,
.audio-progress{
  -webkit-tap-highlight-color:transparent;
}
button,
.quick-link,
.chip,
.post,
.comment-bubble,
.compact-comment,
.calendar-grid .day,
.calendar-event-row,
.image-attachment,
.pretty-audio-player{
  transition:
    transform .18s var(--tap-ease),
    box-shadow .18s var(--tap-ease),
    background-color .18s var(--tap-ease),
    border-color .18s var(--tap-ease),
    color .18s var(--tap-ease),
    opacity .18s var(--tap-ease),
    filter .18s var(--tap-ease);
}
.primary-btn,
.secondary-btn,
.join-btn,
.ghost-btn,
.quick-link,
.chip,
.calendar-arrow,
.calendar-grid button.day,
.calendar-event-row,
.exercise-option,
.icon-action,
.comment-like-btn,
.compact-reply-btn,
.reply-link,
.view-all-comments,
.audio-control-btn,
.audio-progress,
.image-attach-btn,
.voice-record-btn,
.composer-trigger,
.image-attachment{
  touch-action:manipulation;
}
.primary-btn:hover,
.join-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.quick-link:hover,
.chip:hover,
.calendar-arrow:hover,
.load-more-wrap .secondary-btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--tap-shadow);
}
.primary-btn:hover,
.join-btn:hover{
  box-shadow:var(--tap-shadow-strong);
  filter:saturate(1.06);
}
.primary-btn:active,
.join-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.quick-link:active,
.chip:active,
.calendar-arrow:active,
.calendar-grid button.day:active,
.calendar-event-row:active,
.exercise-option:active:not(:disabled),
.composer-trigger:active,
.image-attachment:active{
  transform:translateY(1px) scale(.985);
  box-shadow:0 5px 14px rgba(17,24,39,.08)!important;
}
.icon-action:active,
.comment-like-btn:active,
.compact-reply-btn:active,
.reply-link:active,
.view-all-comments:active,
.audio-control-btn:active,
.audio-progress:active,
.image-attach-btn:active,
.voice-record-btn:active{
  transform:scale(.92);
}
button:disabled,
button[aria-disabled="true"]{
  cursor:not-allowed!important;
  opacity:.58;
  transform:none!important;
  filter:saturate(.8);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.image-attachment:focus-visible,
.audio-progress:focus-visible{
  outline:3px solid rgba(79,70,229,.24)!important;
  outline-offset:3px;
}
.composer-trigger:hover span{
  border-color:#d8d5ff;
  background:#f8f7ff;
  color:#667085;
}
.composer-trigger:active span{
  background:#f1efff;
}
.icon-action{
  min-width:36px;
  min-height:34px;
  justify-content:center;
  will-change:transform;
}
.icon-action:hover{
  background:#f6f7fb!important;
  color:#4b5563;
}
.icon-action.liked:hover{
  background:#fff1f2!important;
}
.comment-like-btn,
.compact-reply-btn,
.reply-link,
.view-all-comments{
  min-height:28px!important;
}
.comment-like-btn:hover,
.compact-reply-btn:hover,
.reply-link:hover,
.view-all-comments:hover{
  color:#4f46e5!important;
}
.comment-like-btn.liked:hover{
  color:#ef4444!important;
}
.exercise-option:hover:not(:disabled){
  box-shadow:0 8px 18px rgba(79,70,229,.08);
}
.calendar-event-row:hover{
  border-color:#d8d5ff!important;
  box-shadow:0 10px 24px rgba(79,70,229,.10)!important;
}
.load-more-wrap .secondary-btn{
  position:relative;
  min-height:42px;
}
.load-more-wrap .secondary-btn:disabled::after{
  content:"";
  width:14px;
  height:14px;
  margin-left:8px;
  border-radius:999px;
  border:2px solid rgba(79,70,229,.22);
  border-top-color:var(--brand);
  display:inline-block;
  vertical-align:-2px;
  animation:buttonSpin .75s linear infinite;
}
@keyframes buttonSpin{
  to{transform:rotate(360deg);}
}
.feed-reveal{
  opacity:0;
  transform:translateY(18px);
  transition:
    opacity .42s var(--tap-ease) var(--reveal-delay,0ms),
    transform .42s var(--tap-ease) var(--reveal-delay,0ms),
    box-shadow .18s var(--tap-ease),
    border-color .18s var(--tap-ease);
  will-change:opacity,transform;
}
.feed-reveal.is-visible{
  opacity:1;
  transform:translateY(0);
}
@media (hover:hover){
  .post:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 34px rgba(17,24,39,.075)!important;
    border-color:#dedff0!important;
  }
  .post:hover .post-content a,
  .detail-post-card .post-content a:hover{
    color:#4f46e5;
  }
  .compact-comment:hover .comment-bubble,
  .thread-comment:hover .comment-bubble{
    border-color:#e1e5f0;
  }
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *,
  *::before,
  *::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
  }
  .feed-reveal{
    opacity:1!important;
    transform:none!important;
  }
  .store-item.rarity-premium::before,
  .store-item.rarity-premium::after{
    animation:none!important;
  }
}

/* Nopis store */
.store-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:16px;
}
.store-item{
  position:relative;
  overflow:hidden;
  display:grid;
  align-content:space-between;
  gap:16px;
  min-height:230px;
  padding:16px;
  border:1px solid var(--ring);
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 22px rgba(17,24,39,.04);
}
.store-item::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.08;
  background:linear-gradient(135deg,#4f46e5,#facc15);
}
.store-item > *{
  position:relative;
  z-index:1;
}
.store-item.rarity-common::before{
  background:linear-gradient(135deg,#94a3b8,#e2e8f0);
}
.store-item.rarity-uncommon{
  border-color:rgba(34,197,94,.28);
}
.store-item.rarity-uncommon::before{
  background:linear-gradient(135deg,#22c55e,#86efac);
}
.store-item.rarity-rare{
  border-color:rgba(20,184,166,.28);
}
.store-item.rarity-rare::before{
  background:linear-gradient(135deg,#14b8a6,#60a5fa);
}
.store-item.rarity-epic{
  border-color:rgba(124,58,237,.28);
}
.store-item.rarity-epic::before{
  background:linear-gradient(135deg,#7c3aed,#ec4899);
}
.store-item.rarity-premium{
  border:1px solid transparent;
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(120deg,#facc15,#ec4899,#7c3aed,#60a5fa,#facc15) border-box;
  box-shadow:0 18px 42px rgba(124,58,237,.16);
}
.store-item.rarity-premium::before{
  opacity:.16;
  background:linear-gradient(120deg,#facc15,#ec4899,#7c3aed,#60a5fa,#facc15);
  background-size:260% 260%;
  animation:premiumRewardGlow 5s ease infinite;
}
.store-item.rarity-premium::after{
  content:"";
  position:absolute;
  inset:-45%;
  pointer-events:none;
  background:linear-gradient(115deg,transparent 38%,rgba(255,255,255,.55) 50%,transparent 62%);
  transform:translateX(-35%) rotate(8deg);
  animation:premiumRewardSweep 4.8s ease-in-out infinite;
}
.store-item.rarity-premium .store-delivery{
  color:#7c2d12;
  background:#fff7db;
  border-color:rgba(250,204,21,.65);
}
@keyframes premiumRewardGlow{
  0%,100%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
}
@keyframes premiumRewardSweep{
  0%,45%{transform:translateX(-50%) rotate(8deg);opacity:0;}
  58%{opacity:.85;}
  74%,100%{transform:translateX(55%) rotate(8deg);opacity:0;}
}
.store-item h2{
  margin:8px 0 6px;
  font-size:1.05rem;
  line-height:1.2;
  letter-spacing:-.025em;
}
.store-item p{
  margin:0;
  color:var(--muted);
  font-size:.9rem;
  line-height:1.45;
}
.store-delivery{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  padding:5px 9px;
  border-radius:999px;
  background:#f5f3ff;
  color:var(--brand-dark);
  border:1px solid #ddd6fe;
  font-size:.72rem;
  font-weight:800;
}
.store-item-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.store-item-bottom strong{
  color:var(--brand-dark);
  font-weight:800;
  white-space:nowrap;
}
.store-item-cost{
  display:flex;align-items:center;gap:5px;
}
.store-history-card{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--ring);
}
.store-history-card h3{
  margin:0 0 10px;
  font-size:.98rem;
}
.store-redemptions{
  display:grid;
  gap:8px;
}
.store-redemption-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--ring);
  border-radius:14px;
  background:#f9fafb;
}
.store-redemption-row strong,
.store-redemption-row span{
  display:block;
}
.store-redemption-row span{
  color:var(--muted);
  font-size:.76rem;
  margin-top:2px;
}
.store-redemption-row b{
  color:#8a6100;
  background:#fff7db;
  border:1px solid rgba(250,204,21,.5);
  border-radius:999px;
  padding:4px 8px;
  font-size:.74rem;
  text-transform:capitalize;
}
@media (hover:hover){
  .store-item:hover{
    transform:translateY(-2px);
    border-color:#dedff0;
    box-shadow:0 14px 34px rgba(17,24,39,.075);
  }
}
@media (max-width:760px){
  .store-grid{
    grid-template-columns:1fr;
  }
  .store-item{
    min-height:0;
    padding:14px;
  }
  .store-item-bottom{
    align-items:stretch;
    flex-direction:column;
  }
  .store-item-bottom .primary-btn{
    width:100%;
  }
}

/* ── Mobile bottom navigation ──────────────────────────────────────────────── */
.mobile-bottom-nav{display:none;}

@media (max-width:760px){
  .mobile-bottom-nav:not(.hidden){
    display:flex;
    position:fixed;
    bottom:0;left:0;right:0;
    height:calc(60px + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);
    background:rgba(255,255,255,.97);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--ring);
    z-index:80;
    justify-content:space-around;
    align-items:stretch;
  }

  /* Push page content above the bar */
  body.has-mobile-nav{padding-bottom:calc(60px + env(safe-area-inset-bottom));}

  .mobile-nav-btn{
    flex:1;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:center;
    gap:3px;
    background:none;
    border:0;
    cursor:pointer;
    color:#9ca3af;
    font-size:.65rem;
    font-weight:700;
    padding:0;
    transition:color .15s ease;
    -webkit-tap-highlight-color:transparent;
  }
  .mobile-nav-btn:active{transform:scale(.92);}
  .mobile-nav-btn.active{color:var(--brand);}
  .mobile-nav-btn.active svg{stroke:var(--brand);}

  .mobile-nav-icon-wrap{
    position:relative;
    display:inline-flex;
  }
  .mobile-nav-badge{
    position:absolute;
    top:-4px;right:-6px;
    min-width:16px;height:16px;
    background:#ef4444;
    color:#fff;
    font-size:.6rem;
    font-weight:900;
    border-radius:999px;
    display:grid;place-items:center;
    padding:0 3px;
    line-height:1;
  }
  .mobile-nav-avatar{
    width:28px!important;height:28px!important;
    font-size:.75rem!important;
    border-radius:999px;
  }
}

/* ── Vocabulary Library ─────────────────────────────────────────────────── */
.vocab-page{max-width:800px;margin:0 auto;padding:24px 16px 80px;}
.vocab-page-header{margin-bottom:20px;}
.vocab-page-header h2{font-size:1.4rem;font-weight:900;margin:0 0 4px;}
.vocab-page-header p{font-size:.84rem;color:var(--muted);}

/* Stats strip */
.vocab-stats-strip{
  display:grid;grid-template-columns:repeat(2,1fr);
  border:1px solid var(--ring);border-radius:10px;
  overflow:hidden;background:#fff;margin-bottom:20px;
}
.vocab-stat{padding:14px 12px;border-right:1px solid var(--ring);text-align:center;}
.vocab-stat:last-child{border-right:none;}
.vocab-stat strong{display:block;font-size:1.4rem;font-weight:900;color:var(--brand);line-height:1;}
.vocab-stat span{display:block;font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;margin-top:3px;}

/* Filters */
.vocab-filters{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:18px;}
.vocab-filter-chip{
  padding:.32rem .75rem;font-size:.76rem;font-weight:700;
  border:1.5px solid var(--ring);border-radius:999px;
  background:#fff;color:var(--muted);cursor:pointer;transition:all .12s;
  font-family:inherit;
}
.vocab-filter-chip:hover{border-color:var(--brand);color:var(--brand);}
.vocab-filter-chip.active{background:var(--brand);color:#fff;border-color:var(--brand);}
.vocab-search-input{
  border:1.5px solid var(--ring);border-radius:999px;padding:.32rem .85rem;
  font-size:.8rem;outline:none;font-family:inherit;min-width:160px;
  transition:border-color .15s;
}
.vocab-search-input:focus{border-color:var(--brand);}

/* Section label */
.vocab-section-label{
  font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;
  color:#aaa;margin:20px 0 8px;
  display:flex;align-items:center;gap:8px;
}
.vocab-section-label::after{content:'';flex:1;height:1px;background:var(--ring);}

/* Word grid */
.vocab-word-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;
}
@media(max-width:680px){.vocab-word-grid{grid-template-columns:1fr 1fr;}}
@media(max-width:420px){.vocab-word-grid{grid-template-columns:1fr;}}

/* Word card */
.vocab-word-card{
  background:#fff;border:1.5px solid var(--ring);border-radius:10px;
  padding:14px;cursor:pointer;transition:border-color .15s,box-shadow .15s;
  position:relative;text-align:left;font-family:inherit;
}
.vocab-word-card:hover{border-color:var(--brand);box-shadow:0 4px 14px rgba(79,70,229,.09);}
.vocab-word-card.status-learned{border-left:3px solid var(--brand);}
.vocab-word-card.status-reviewing{border-left:3px solid #8b5cf6;}
.vocab-word-kanji-text{font-size:1.4rem;font-weight:900;line-height:1;margin-bottom:2px;}
.vocab-word-reading-text{font-size:.72rem;color:var(--muted);margin-bottom:4px;font-weight:600;}
.vocab-word-meaning-text{font-size:.8rem;color:var(--ink);font-weight:700;margin-bottom:8px;}
.vocab-word-card-footer{display:flex;align-items:center;gap:5px;flex-wrap:wrap;}
.vocab-level-badge{
  font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;
  padding:.12rem .4rem;border-radius:3px;
  border:1.5px solid var(--brand);color:var(--brand);
}
.vocab-source-label{font-size:.66rem;color:var(--muted);font-weight:600;}
.vocab-status-dot{
  width:7px;height:7px;border-radius:50%;margin-left:auto;flex-shrink:0;
}
.vocab-dot-learned{background:var(--brand);}
.vocab-dot-reviewing{background:#8b5cf6;}
.vocab-dot-new{background:#d1d5db;}

/* Empty state */
.vocab-empty{text-align:center;padding:40px 20px;color:var(--muted);}
.vocab-empty .big{font-size:2.5rem;margin-bottom:8px;}

/* Loading */
.vocab-loading{text-align:center;padding:32px;color:var(--muted);font-size:.9rem;}

/* ── Vocabulary word modal ───────────────────────────────────────────────── */
.vocab-word-modal{
  position:fixed;inset:0;background:rgba(0,0,0,.45);
  z-index:200;display:grid;place-items:center;padding:20px;
}
.vocab-word-modal.hidden{display:none;}
.vocab-word-dialog{
  background:#fff;border-radius:16px;width:100%;max-width:440px;
  padding:28px;position:relative;
}
.vocab-word-kicker{
  display:inline-block;font-size:.7rem;font-weight:800;text-transform:uppercase;
  letter-spacing:.08em;padding:.2rem .5rem;border-radius:4px;
  background:#eef2ff;color:var(--brand);margin-bottom:12px;
}
.vocab-word-kanji{font-size:2.8rem;font-weight:900;line-height:1;margin-bottom:3px;}
.vocab-word-reading{font-size:.88rem;color:var(--muted);margin-bottom:4px;}
.vocab-word-meaning{font-size:1.1rem;font-weight:800;margin-bottom:14px;}
.vocab-word-example{
  font-size:.85rem;color:#444;line-height:1.6;white-space:pre-wrap;
  background:#f9fafb;border:1px solid var(--ring);border-radius:6px;
  padding:10px 12px;margin-bottom:12px;
}
.vocab-word-source{font-size:.75rem;color:var(--muted);margin-bottom:18px;}
.vocab-status-btns{display:flex;gap:8px;}
.vocab-status-btn{
  flex:1;padding:.55rem;font-size:.78rem;font-weight:800;
  border-radius:6px;cursor:pointer;border:1.5px solid var(--ring);
  background:#fff;transition:all .12s;font-family:inherit;color:var(--ink);
}
.vocab-status-btn:hover{border-color:var(--brand);color:var(--brand);}
.vocab-status-btn.primary{background:var(--brand);color:#fff;border-color:var(--brand);}
.vocab-status-btn.primary:hover{background:#4338ca;}
.vocab-status-btn.btn-active{background:var(--brand);color:#fff;border-color:var(--brand);}

/* Vocab carousel — 2 rows, horizontal paging with arrows */
.vocab-carousel-wrap{display:flex;align-items:center;gap:6px;}
.vocab-carousel{
  flex:1;display:flex;overflow-x:auto;min-width:0;
  scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.vocab-carousel::-webkit-scrollbar{display:none;}
.vocab-car-page{flex:0 0 100%;min-width:100%;scroll-snap-align:start;}
.vocab-word-grid-2row{
  display:grid;grid-template-columns:repeat(3,1fr);
  grid-auto-rows:auto;gap:8px;padding:2px;
}
@media (max-width:560px){
  .vocab-word-grid-2row{grid-template-columns:repeat(2,1fr);}
}
.vocab-car-arrow{
  flex:0 0 auto;width:32px;height:32px;border-radius:50%;
  border:1.5px solid var(--ring);background:#fff;cursor:pointer;
  font-size:20px;line-height:1;display:flex;align-items:center;justify-content:center;
  color:var(--ink);font-family:inherit;padding:0 0 3px 0;transition:all .12s;
}
.vocab-car-arrow:hover:not(:disabled){border-color:var(--brand);color:var(--brand);}
.vocab-car-arrow:disabled{opacity:.3;cursor:default;}

/* Vocab level distribution chart */
.vocab-level-chart{margin-bottom:14px;display:grid;gap:6px;}
.vocab-section-mini-label{font-size:.68rem;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:2px;}
.vlc-row{display:grid;grid-template-columns:30px 1fr 26px;align-items:center;gap:8px;}
.vlc-label{font-size:.74rem;font-weight:900;}
.vlc-track{height:10px;background:#f3f4f6;border-radius:999px;overflow:hidden;}
.vlc-bar{height:100%;border-radius:999px;transition:width .4s ease;}
.vlc-count{font-size:.74rem;font-weight:800;color:var(--muted);text-align:right;}

/* Compact profile on mobile */
@media (max-width:760px){
  .profile-main{gap:10px;padding:6px 0 4px;}
  .profile-avatar-section{gap:5px;}
  .profile-avatar-wrap{width:84px;height:84px;padding:5px;}
  .profile-avatar-wrap .profile-photo{width:74px!important;height:74px!important;}
  .avatar-upload-btn{padding:.35rem .75rem;font-size:.72rem;}
  .profile-avatar-status{margin:0;}
  .profile-identity h2{font-size:1.25rem;margin-bottom:5px;}
  .profile-identity .profile-tier-label,
  .profile-level-badge{padding:.22rem .65rem;font-size:.7rem;}
  .profile-stats-row{grid-template-columns:repeat(4,1fr);gap:6px;}
  .pstat{padding:8px 4px;border-radius:12px;gap:2px;}
  .pstat strong{font-size:.95rem;}
  .pstat>span{font-size:.56rem;}
  .profile-country-card{padding:10px 12px;}
  .profile-country-card label{font-size:.7rem;}
  .profile-main .profile-actions button{padding:.5rem;font-size:.8rem;}
  .completed-missions-card{padding:14px;}
}

/* Tighter reserved space under post detail comments (composer is ~70px tall) */
.detail-comments-section{padding-bottom:96px!important;}
.detail-comment-form{padding:10px 18px calc(8px + env(safe-area-inset-bottom))!important;}
@media (max-width:760px){
  .detail-comments-section{padding-bottom:100px!important;}
  .detail-comment-form{padding:8px 12px calc(8px + env(safe-area-inset-bottom))!important;}
}

/* Comment composer flows right after the comments — no pinned bar, no dead space */
.detail-comment-form{
  position:static!important;
  left:auto;right:auto;bottom:auto;
  transform:none!important;
  width:auto!important;
  box-shadow:none!important;
  background:transparent!important;
  backdrop-filter:none!important;
  border-top:1px solid var(--ring)!important;
  margin:14px 0 0!important;
  padding:12px 0 calc(4px + env(safe-area-inset-bottom))!important;
}
.detail-comments-section{padding-bottom:20px!important;}
/* Shell shows the page background below the content instead of endless white */
.post-detail-shell{background:#f5f6fb;box-shadow:none;}
.detail-post-card{background:#fff;}
.detail-comments-section{background:#fff;border-bottom:1px solid var(--ring);}

/* Comment bar locked to the bottom of the screen while inside a post */
.detail-comment-form{
  position:fixed!important;
  left:50%!important;
  bottom:0!important;
  transform:translateX(-50%)!important;
  width:min(820px,100vw)!important;
  z-index:80;
  margin:0!important;
  padding:10px 18px calc(10px + env(safe-area-inset-bottom))!important;
  background:rgba(255,255,255,.98)!important;
  backdrop-filter:blur(14px)!important;
  border-top:1px solid var(--ring)!important;
  box-shadow:0 -10px 28px rgba(17,24,39,.08)!important;
}
.detail-comments-section{padding-bottom:96px!important;}
@media (max-width:760px){
  .detail-comment-form{
    left:0!important;
    transform:none!important;
    width:100vw!important;
    padding:8px 12px calc(8px + env(safe-area-inset-bottom))!important;
  }
}

/* Post detail rebuilt as flex column: scrollable content + composer docked
   by layout (no position:fixed). Overrides all earlier composer positioning. */
.post-detail-shell{display:flex;flex-direction:column;overflow:hidden;}
@media (max-width:760px){
  .post-detail-shell{height:calc(100dvh - 53px);}
}
.detail-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;}
.detail-comments-section{padding-bottom:24px!important;border-bottom:none;}
.detail-comment-form{
  position:static!important;
  left:auto!important;right:auto!important;bottom:auto!important;
  transform:none!important;
  width:auto!important;
  flex:0 0 auto;
  margin:0!important;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom))!important;
  background:#fff!important;
  backdrop-filter:none!important;
  border-top:1px solid var(--ring)!important;
  box-shadow:0 -6px 18px rgba(17,24,39,.06)!important;
}

/* Shell fills the modal exactly — no dvh math that drifts on mobile Safari */
.post-detail-shell{height:100%!important;}
@media (max-width:760px){
  .post-detail-shell{height:100%!important;}
}
.detail-comment-form{padding:8px 14px calc(6px + env(safe-area-inset-bottom))!important;}

/* Collapse empty preview/status slots — they created phantom grid rows
   (~42px of white) under the comment input. They reappear when JS fills
   them (voice recording, image preview, recording status). */
.detail-comment-form .voice-preview-slot:empty,
.detail-comment-form .image-preview-slot:empty,
.detail-comment-form .voice-record-status:empty{display:none!important;}

/* ── Daily Practice ─────────────────────────────────────────────────────── */
.practice-hero{display:flex;align-items:center;justify-content:space-between;gap:14px;background:linear-gradient(135deg,var(--brand),#7c3aed);border-radius:18px;padding:18px 20px;margin-bottom:16px;color:#fff;}
.practice-hero-text h3{margin:0 0 2px;font-size:1.05rem;color:#fff;}
.practice-hero-text p{margin:0;font-size:.82rem;opacity:.85;}
.practice-start-btn{background:#fff;color:var(--brand);border:0;border-radius:999px;padding:10px 26px;font-weight:800;font-size:.95rem;cursor:pointer;flex-shrink:0;transition:transform .12s;}
.practice-start-btn:hover{transform:scale(1.05);}

.practice-screen{max-width:560px;margin:0 auto;}
.practice-topbar{display:flex;align-items:center;gap:12px;margin-bottom:18px;}
.practice-exit-btn{background:none;border:1px solid var(--ring);border-radius:50%;width:32px;height:32px;cursor:pointer;color:var(--muted);font-size:.9rem;flex-shrink:0;}
.practice-exit-btn:hover{border-color:#ef4444;color:#ef4444;}
.practice-progress-track{flex:1;height:8px;background:var(--soft);border-radius:999px;overflow:hidden;}
.practice-progress-fill{height:100%;background:var(--brand);border-radius:999px;transition:width .3s ease;}
.practice-count{font-size:.8rem;font-weight:700;color:var(--muted);flex-shrink:0;}

.practice-question-card{background:#fff;border:1px solid var(--ring);border-radius:20px;padding:24px 20px;text-align:center;}
.practice-instruction{font-size:.82rem;color:var(--muted);margin:0 0 16px;}
.practice-mc-prompt{font-size:1.7rem;font-weight:800;color:var(--ink);margin-bottom:6px;}
.practice-cloze-sentence{font-size:1.25rem;font-weight:700;color:var(--ink);line-height:1.6;margin-bottom:8px;}
.practice-cloze-hint{font-size:.82rem;color:var(--muted);margin-bottom:8px;}
.practice-options{margin-top:18px;text-align:left;}

.practice-flashcard{display:block;width:100%;min-height:170px;background:var(--soft);border:2px dashed var(--ring);border-radius:18px;cursor:pointer;padding:24px;transition:border-color .15s;}
.practice-flashcard:hover{border-color:var(--brand);}
.practice-flashcard.is-flipped{border-style:solid;border-color:var(--brand);background:#fff;cursor:default;}
.practice-flash-word{font-size:2rem;font-weight:800;color:var(--ink);}
.practice-flash-word.small{font-size:1.1rem;color:var(--muted);margin-top:4px;}
.practice-flash-reading{font-size:.95rem;color:var(--muted);margin-top:4px;}
.practice-flash-meaning{font-size:1.4rem;font-weight:800;color:var(--brand);}
.practice-flash-example{font-size:.85rem;color:var(--muted);margin-top:10px;line-height:1.5;}
.practice-flash-actions{display:flex;gap:10px;margin-top:16px;}
.practice-flash-actions.hidden{display:none;}
.practice-flash-btn{flex:1;border:0;border-radius:14px;padding:13px;font-weight:800;font-size:.9rem;cursor:pointer;}
.practice-flash-btn.knew{background:#dcfce7;color:#15803d;}
.practice-flash-btn.knew:hover{background:#bbf7d0;}
.practice-flash-btn.missed{background:#fef3c7;color:#b45309;}
.practice-flash-btn.missed:hover{background:#fde68a;}

.practice-results{max-width:420px;margin:24px auto;text-align:center;background:#fff;border:1px solid var(--ring);border-radius:20px;padding:32px 24px;}
.practice-results-score{font-size:3rem;font-weight:900;color:var(--brand);}
.practice-results-score small{font-size:1.4rem;color:var(--muted);font-weight:700;}
.practice-results h3{margin:6px 0 10px;}
.practice-results-nopis{font-weight:800;color:#b45309;background:#fef3c7;border-radius:999px;padding:8px 18px;display:inline-block;}
.practice-results-actions{display:flex;flex-direction:column;gap:10px;margin-top:18px;}

/* ── Grammar points ─────────────────────────────────────────────────────── */
.grammar-card-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:18px;}
@media (max-width:560px){.grammar-card-grid{grid-template-columns:1fr;}}
.grammar-card{
  background:linear-gradient(135deg,#f5f3ff,#ede9fe);
  border:1px solid #ddd6fe;border-radius:16px;padding:14px 16px;
  text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:4px;
  transition:transform .12s, box-shadow .12s;
}
.grammar-card:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(124,58,237,.15);}
.grammar-card-name{font-size:1.15rem;font-weight:900;color:var(--brand-dark);}
.grammar-card-meaning{font-size:.82rem;color:var(--muted);}
.grammar-card .vocab-level-badge{align-self:flex-start;margin-top:4px;}
.grammar-modal-name{font-size:1.9rem;font-weight:900;color:var(--brand-dark);margin:6px 0 2px;}
.grammar-modal-explanation{font-size:.9rem;color:var(--ink);line-height:1.5;margin:8px 0;}
.grammar-modal-block{background:var(--soft);border-radius:12px;padding:10px 12px;margin-top:8px;text-align:left;}
.grammar-modal-label{font-size:.66rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);display:block;margin-bottom:3px;}
.grammar-modal-structure,.grammar-modal-example{font-size:.92rem;font-weight:700;color:var(--ink);line-height:1.5;}
.practice-grammar-chip{
  display:inline-block;background:#ede9fe;color:var(--brand-dark);
  border-radius:999px;padding:5px 12px;font-size:.76rem;font-weight:800;margin-bottom:10px;
}

/* Practice loading bar */
.practice-loader{max-width:340px;margin:60px auto;text-align:center;}
.practice-loader-emoji{font-size:2.4rem;animation:practiceBounce 1s ease-in-out infinite;}
.practice-loader-track{height:10px;background:var(--soft);border-radius:999px;overflow:hidden;margin:18px 0 12px;}
.practice-loader-fill{height:100%;width:40%;border-radius:999px;background:linear-gradient(90deg,var(--brand),#7c3aed);animation:practiceSlide 1.1s ease-in-out infinite;}
.practice-loader-label{font-size:.85rem;color:var(--muted);font-weight:600;margin:0;}
@keyframes practiceSlide{
  0%{transform:translateX(-110%);}
  100%{transform:translateX(290%);}
}
@keyframes practiceBounce{
  0%,100%{transform:translateY(0) scale(1);}
  50%{transform:translateY(-7px) scale(1.08);}
}

@media (max-width:560px){
  .practice-hero{padding:14px 16px;}
  .practice-question-card{padding:18px 14px;}
  .practice-mc-prompt{font-size:1.4rem;}
  .practice-flash-word{font-size:1.6rem;}
}

/* Vocab full-page back button */
.vocab-back-btn{background:none;border:0;color:var(--brand);font-size:.85rem;font-weight:700;cursor:pointer;padding:0 0 8px;display:block;}
.vocab-back-btn:hover{text-decoration:underline;}

.vocab-see-all-btn{width:100%;margin-top:4px;}

/* ════════════════════════════════════════════════════════════════════════════
   GLASS REDESIGN — premium glassmorphism layer matching the brand materials.
   Appended as an override layer so the whole redesign is one contained block.
   ════════════════════════════════════════════════════════════════════════════ */

:root{
  --glass:rgba(255,255,255,.62);
  --glass-strong:rgba(255,255,255,.78);
  --glass-border:rgba(124,58,237,.13);
  --glass-shadow:0 18px 44px rgba(79,70,229,.10);
  --glass-blur:16px;
  --kanji-wm:#edeafd;
}

/* Typography: Poppins for headings/brand, Inter for reading text */
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;}
h1,h2,h3,h4,.brand,.quick-link,.join-btn,.primary-btn,.secondary-btn,.ghost-btn,
.practice-start-btn,.vocab-word-kanji-text,.section-heading{font-family:Poppins,Inter,system-ui,sans-serif;}

/* Background: soft white-to-lavender wash */
body{background:linear-gradient(180deg,#ffffff 0%,#f6f5ff 60%,#f1efff 100%) fixed;}

/* Floating Japanese characters background */
.kana-field{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;color:#7c6ee0;}
.kana{
  position:absolute;
  bottom:-12vh;
  will-change:transform,opacity;
  opacity:var(--o,.07);
  font-size:var(--s,2rem);
  font-weight:700;
  line-height:1;
  color:currentColor;
  animation:kanaFloat var(--d,30s) linear var(--delay,0s) infinite;
}
@keyframes kanaFloat{
  0%{transform:translateY(0) translateX(0);opacity:0;}
  10%{opacity:var(--o,.07);}
  90%{opacity:var(--o,.07);}
  100%{transform:translateY(-115vh) translateX(var(--drift,0px));opacity:0;}
}
@media (prefers-reduced-motion:reduce){.kana{display:none;}}
/* Content sits above the kana field. NOTE: .topbar and .mobile-bottom-nav are
   position:fixed and must NOT be forced to relative — they already stack above. */
main,.view,.layout,.page-view{position:relative;z-index:1;}

/* ── Glass surfaces ── */
.card,
.composer,
.page-panel,
.notif-panel,
.msg-panel,
.nopis-popup,
.admin-dash-panel,
.practice-question-card,
.practice-results,
.noa-cal-form,
.noa-stat-card,
.noa-event-item{
  background:var(--glass)!important;
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(160%);
  backdrop-filter:blur(var(--glass-blur)) saturate(160%);
  border:1px solid var(--glass-border)!important;
  box-shadow:var(--glass-shadow)!important;
}
.card{border-radius:22px;}

/* Topbar: brighter frosted bar */
.topbar{
  background:rgba(255,255,255,.7)!important;
  -webkit-backdrop-filter:blur(18px) saturate(170%);
  backdrop-filter:blur(18px) saturate(170%);
  border-bottom:1px solid var(--glass-border)!important;
}

/* Modals: frosted dialogs over a soft veil */
.auth-modal,.post-detail-modal,.vocab-word-modal,.calendar-event-modal{background:rgba(49,38,107,.32)!important;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);}
.auth-dialog,.vocab-word-dialog,.calendar-event-dialog,.post-detail-shell{
  background:var(--glass-strong)!important;
  -webkit-backdrop-filter:blur(22px) saturate(170%);
  backdrop-filter:blur(22px) saturate(170%);
  border:1px solid var(--glass-border)!important;
}

/* Comments + inner blocks: lighter frosted tint */
.comment{background:rgba(255,255,255,.55)!important;border:1px solid rgba(124,58,237,.10)!important;}
.exercise-block{background:rgba(245,243,255,.5);border:1px solid var(--glass-border);border-radius:18px;padding:14px;}
.exercise-option{background:rgba(255,255,255,.7)!important;border:1px solid var(--glass-border)!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);}

/* Buttons: primary keeps the gradient with a glossy edge, secondary goes frosted */
.join-btn,.primary-btn{
  background:linear-gradient(135deg,var(--brand),var(--purple))!important;
  box-shadow:0 12px 26px rgba(99,53,230,.30),inset 0 1px 0 rgba(255,255,255,.35)!important;
}
/* Start sits ON the purple hero — must stay a white pill with purple text */
.practice-start-btn{background:#fff!important;color:var(--brand)!important;box-shadow:0 8px 20px rgba(17,24,39,.18)!important;}
.secondary-btn,.ghost-btn{
  background:rgba(255,255,255,.6)!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  border:1px solid var(--glass-border)!important;
}

/* Quick links: frosted pills, gradient when active */
.quick-link{background:rgba(255,255,255,.55);border:1px solid var(--glass-border);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);}
.quick-link.active{background:linear-gradient(135deg,var(--brand),var(--purple));color:#fff;border-color:transparent;box-shadow:0 10px 22px rgba(99,53,230,.28);}

/* Mobile bottom nav: floating frosted dock */
.mobile-bottom-nav{
  background:rgba(255,255,255,.66)!important;
  -webkit-backdrop-filter:blur(18px) saturate(170%);
  backdrop-filter:blur(18px) saturate(170%);
  border-top:1px solid var(--glass-border)!important;
  box-shadow:0 -10px 30px rgba(79,70,229,.10)!important;
}

/* Vocab cards + grammar cards: frosted with gradient hover lift */
.vocab-word-card{
  background:rgba(255,255,255,.62)!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  border:1px solid var(--glass-border)!important;
  transition:transform .14s ease,box-shadow .14s ease;
}
.vocab-word-card:hover{transform:translateY(-3px);box-shadow:0 16px 32px rgba(99,53,230,.16);}
.grammar-card{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);}

/* Practice surfaces */
.practice-flashcard{background:rgba(245,243,255,.55)!important;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);}
.practice-hero{box-shadow:0 16px 36px rgba(99,53,230,.30);}

/* Calendar day cells: frosted */
.calendar-grid .day{background:rgba(255,255,255,.6)!important;border:1px solid rgba(124,58,237,.10)!important;}
.calendar-grid .day.muted-day{background:rgba(248,250,252,.45)!important;}
.calendar-grid .day.has-event{background:linear-gradient(135deg,var(--brand),var(--purple))!important;border-color:transparent!important;}

/* Detail comment bar: frosted dock */
.detail-comment-form{
  background:rgba(255,255,255,.78)!important;
  -webkit-backdrop-filter:blur(16px) saturate(160%);
  backdrop-filter:blur(16px) saturate(160%);
  border-top:1px solid var(--glass-border)!important;
}

/* Gradient headline accent: section headings get a subtle brand pop */
.section-heading h2,.vocab-page-header h2{letter-spacing:-.02em;}
.profile-level-badge,.vocab-level-badge{box-shadow:inset 0 1px 0 rgba(255,255,255,.5);}

/* Fallback for browsers without backdrop-filter: solid near-white */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .card,.composer,.page-panel,.auth-dialog,.vocab-word-dialog,.calendar-event-dialog,
  .notif-panel,.msg-panel,.topbar,.mobile-bottom-nav,.detail-comment-form{background:rgba(255,255,255,.95)!important;}
}

/* Mobile: lighter blur for performance */
@media (max-width:760px){
  :root{--glass-blur:10px;}
  .kana{font-size:calc(var(--s,2rem) * .8);}
}

/* ── Slim audio player (replaces the waveform player) ──────────────────────── */
.slim-audio-player{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:430px;
  padding:7px 12px 7px 7px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.72)!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  border:1px solid var(--glass-border)!important;
  box-shadow:0 8px 20px rgba(79,70,229,.08)!important;
}
.slim-audio-player .audio-play-btn{
  width:36px;
  height:36px;
  min-width:36px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  box-shadow:0 6px 14px rgba(99,53,230,.30);
  font-size:.7rem;
  transition:transform .12s ease;
}
.slim-audio-player .audio-play-btn:hover{transform:scale(1.06);}
.slim-audio-player .pause-icon{display:none;}
.slim-audio-player.is-playing .play-icon{display:none;}
.slim-audio-player.is-playing .pause-icon{display:inline;}

.audio-seek{
  flex:1 1 auto;
  min-width:50px;
  padding:11px 0;            /* fat touch target around the slim track */
  cursor:pointer;
  touch-action:none;          /* needed so pointermove scrubbing works on phones */
}
.audio-seek-track{
  position:relative;
  height:5px;
  border-radius:999px;
  background:rgba(124,58,237,.16);
}
.audio-seek-fill{
  position:absolute;
  left:0;top:0;bottom:0;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--brand),var(--purple));
}
.audio-seek-thumb{
  position:absolute;
  top:50%;
  left:0%;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;
  border:2.5px solid var(--purple);
  box-shadow:0 2px 7px rgba(79,70,229,.4);
  transform:translate(-50%,-50%);
  transition:transform .1s ease;
}
.slim-audio-player:hover .audio-seek-thumb,
.slim-audio-player.is-scrubbing .audio-seek-thumb{transform:translate(-50%,-50%) scale(1.2);}

.audio-time{
  flex:0 0 auto;
  min-width:36px;
  text-align:right;
  font-size:.74rem;
  font-weight:800;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.slim-audio-player .audio-volume-btn{
  width:30px;
  height:30px;
  min-width:30px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  background:transparent;
  font-size:.85rem;
  display:grid;
  place-items:center;
  opacity:.75;
}
.slim-audio-player .audio-volume-btn:hover{opacity:1;background:rgba(124,58,237,.08);}
.slim-audio-player.is-muted .audio-volume-btn{opacity:.45;}

@media (max-width:560px){
  .slim-audio-player{max-width:100%;gap:8px;}
  .audio-seek-thumb{width:16px;height:16px;} /* easier to grab on phones */
}

/* ── Slim audio player (replaces the waveform player) ──────────────────────── */
.slim-audio-player{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:430px;
  padding:7px 12px 7px 7px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.72)!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  border:1px solid var(--glass-border)!important;
  box-shadow:0 8px 20px rgba(79,70,229,.08)!important;
}
.slim-audio-player .audio-play-btn{
  width:36px;
  height:36px;
  min-width:36px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  box-shadow:0 6px 14px rgba(99,53,230,.30);
  font-size:.7rem;
  transition:transform .12s ease;
}
.slim-audio-player .audio-play-btn:hover{transform:scale(1.06);}
.slim-audio-player .pause-icon{display:none;}
.slim-audio-player.is-playing .play-icon{display:none;}
.slim-audio-player.is-playing .pause-icon{display:inline;}

.audio-seek{
  flex:1 1 auto;
  min-width:50px;
  padding:11px 0;            /* fat touch target around the slim track */
  cursor:pointer;
  touch-action:none;          /* needed so pointermove scrubbing works on phones */
}
.audio-seek-track{
  position:relative;
  height:5px;
  border-radius:999px;
  background:rgba(124,58,237,.16);
}
.audio-seek-fill{
  position:absolute;
  left:0;top:0;bottom:0;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--brand),var(--purple));
}
.audio-seek-thumb{
  position:absolute;
  top:50%;
  left:0%;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;
  border:2.5px solid var(--purple);
  box-shadow:0 2px 7px rgba(79,70,229,.4);
  transform:translate(-50%,-50%);
  transition:transform .1s ease;
}
.slim-audio-player:hover .audio-seek-thumb,
.slim-audio-player.is-scrubbing .audio-seek-thumb{transform:translate(-50%,-50%) scale(1.2);}

.audio-time{
  flex:0 0 auto;
  min-width:36px;
  text-align:right;
  font-size:.74rem;
  font-weight:800;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.slim-audio-player .audio-volume-btn{
  width:30px;
  height:30px;
  min-width:30px;
  flex:0 0 auto;
  border:0;
  border-radius:50%;
  background:transparent;
  font-size:.85rem;
  display:grid;
  place-items:center;
  opacity:.75;
}
.slim-audio-player .audio-volume-btn:hover{opacity:1;background:rgba(124,58,237,.08);}
.slim-audio-player.is-muted .audio-volume-btn{opacity:.45;}

@media (max-width:560px){
  .slim-audio-player{max-width:100%;gap:8px;}
  .audio-seek-thumb{width:16px;height:16px;} /* easier to grab on phones */
}

/* Post detail: keep scrolling inside the modal (no chain-scroll to the page) */
.post-detail-modal{overscroll-behavior:contain;}
.detail-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}

/* Romaji line under grammar example */
.grammar-modal-romaji{font-size:.82rem;font-weight:600;color:var(--muted);font-style:italic;margin-top:2px;}

/* ── Category color coding: left edge + matching chip + faint tint ────────── */
.post,.detail-post-card{border-left:4px solid transparent!important;}

/* General Discussion — slate */
.cat-general-discussion{border-left-color:#94a3b8!important;}
.cat-general-discussion .category{background:#f1f5f9!important;color:#475569!important;border-color:#e2e8f0!important;}

/* Announcement — red */
.cat-announcement{border-left-color:#ef4444!important;}
.cat-announcement .category{background:#fef2f2!important;color:#b91c1c!important;border-color:#fecaca!important;}

/* Daily Exercise — amber */
.cat-daily-exercise{border-left-color:#f59e0b!important;}
.cat-daily-exercise .category{background:#fffbeb!important;color:#b45309!important;border-color:#fde68a!important;}

/* Multiple Choice — blue */
.cat-multiple-choice{border-left-color:#3b82f6!important;}
.cat-multiple-choice .category{background:#eff6ff!important;color:#1d4ed8!important;border-color:#bfdbfe!important;}

/* Voice Exercise — violet */
.cat-voice-exercise{border-left-color:#8b5cf6!important;}
.cat-voice-exercise .category{background:#f5f3ff!important;color:#6d28d9!important;border-color:#ddd6fe!important;}

/* Writing Practice — pink */
.cat-writing-practice{border-left-color:#ec4899!important;}
.cat-writing-practice .category{background:#fdf2f8!important;color:#be185d!important;border-color:#fbcfe8!important;}

/* ── Universal post collapse: fade + Show more pill ────────────────────────── */
.feed-expand-hint{display:none!important;} /* old Read more retired */

#postsContainer .post .post-body-feed{position:relative;}
#postsContainer .post.is-clamped .post-body-feed::after{
  content:'';
  position:absolute;
  left:0;right:0;bottom:0;
  height:84px;
  background:linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.92) 78%);
  pointer-events:none;
}
#postsContainer .post.is-clamped .post-body-feed::before{
  content:'Show more';
  position:absolute;
  left:50%;
  bottom:10px;
  transform:translateX(-50%);
  z-index:2;
  padding:6px 16px;
  border-radius:999px;
  background:rgba(255,255,255,.9);
  border:1px solid var(--glass-border);
  box-shadow:0 6px 16px rgba(79,70,229,.14);
  color:var(--brand);
  font-weight:800;
  font-size:.78rem;
  font-family:Poppins,Inter,system-ui,sans-serif;
  pointer-events:none; /* the whole card click opens the post */
}
@media (max-width:760px){
  #postsContainer .post .post-body-feed{max-height:240px;}
}

/* Category recolors: General Discussion -> toasted yellow; Daily Exercise ->
   green (so it does not clash with the new yellow). Announcement stays red. */
.cat-general-discussion{border-left-color:#d4a300!important;}
.cat-general-discussion .category{background:#fdf6dd!important;color:#8a6400!important;border-color:#eedd9e!important;}
.cat-daily-exercise{border-left-color:#22c55e!important;}
.cat-daily-exercise .category{background:#f0fdf4!important;color:#15803d!important;border-color:#bbf7d0!important;}

/* Feed media sits outside the collapsed text, above the actions row */
.post-feed-media{margin-top:10px;}
.post-feed-media .post-image{max-height:340px;width:auto;max-width:100%;border-radius:14px;object-fit:cover;display:block;}
@media (max-width:560px){.post-feed-media .post-image{max-height:260px;}}

/* Feed image is a small attachment-style thumbnail, not a hero image */
.post-feed-media .post-image{
  max-height:110px!important;
  max-width:170px!important;
  width:auto!important;
  border-radius:12px!important;
  border:1px solid var(--glass-border);
  box-shadow:0 4px 12px rgba(17,24,39,.08);
  cursor:pointer;
}
@media (max-width:560px){
  .post-feed-media .post-image{max-height:90px!important;max-width:140px!important;}
}

/* Speaking Challenge — teal */
.cat-speaking-challenge{border-left-color:#14b8a6!important;}
.cat-speaking-challenge .category{background:#f0fdfa!important;color:#0f766e!important;border-color:#99f6e4!important;}

/* ── Leaderboard: podium + ranked list (contest style) ───────────────────── */
.leaderboard-podium{
  display:flex;align-items:flex-end;justify-content:center;gap:8px;
  margin:10px 0 22px;
}
.podium-slot{
  flex:1 1 0;max-width:130px;min-width:0;
  display:flex;flex-direction:column;align-items:center;text-align:center;
}
.podium-slot.podium-empty{visibility:hidden;}
.podium-crown{font-size:1.5rem;line-height:1;margin-bottom:1px;filter:drop-shadow(0 2px 5px rgba(250,204,21,.45));}
.podium-1 .podium-avatar{width:74px;height:74px;border:3px solid var(--gold);box-shadow:0 8px 22px rgba(250,204,21,.4);}
.podium-2 .podium-avatar,.podium-3 .podium-avatar{width:58px;height:58px;border:3px solid #fff;box-shadow:0 6px 16px rgba(79,70,229,.2);}
.podium-name{font-family:Poppins,Inter,sans-serif;font-weight:800;font-size:.84rem;margin-top:7px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.podium-nopis{display:inline-flex;align-items:center;gap:3px;font-size:.74rem;font-weight:800;color:var(--brand-dark);margin-top:1px;}
.podium-step{
  margin-top:9px;width:100%;border-radius:16px 16px 0 0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  padding:8px 4px 10px;color:#fff;
}
.podium-1 .podium-step{background:linear-gradient(180deg,#fbbf24,#f59e0b);height:98px;}
.podium-2 .podium-step{background:linear-gradient(180deg,#a5b4fc,#818cf8);height:76px;}
.podium-3 .podium-step{background:linear-gradient(180deg,#c4b5fd,#a78bfa);height:64px;}
.podium-rank{font-family:Poppins,Inter,sans-serif;font-size:1.55rem;font-weight:900;line-height:1;}
.podium-prize{font-size:.58rem;font-weight:800;opacity:.96;letter-spacing:.01em;}
.podium-slot.is-me .podium-name{color:var(--brand);}

.leader-rows{display:flex;flex-direction:column;gap:8px;}
.leader-row{
  display:flex;align-items:center;gap:12px;padding:9px 14px;border-radius:14px;
  background:rgba(255,255,255,.6);border:1px solid var(--glass-border);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
}
.leader-row .avatar-wrap{flex:0 0 auto;}
.leader-row-avatar{width:38px;height:38px;}
.leader-row.is-me{background:rgba(124,58,237,.10);border-color:rgba(124,58,237,.35);}
.leader-row-rank{width:24px;text-align:center;font-family:Poppins,Inter,sans-serif;font-weight:900;color:var(--muted);font-size:.92rem;flex:0 0 auto;}
.leader-row.is-me .leader-row-rank{color:var(--brand);}
.leader-row-name{flex:1 1 auto;min-width:0;font-weight:700;font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.leader-row-nopis{display:inline-flex;align-items:center;gap:3px;font-weight:800;font-size:.82rem;color:var(--brand-dark);flex:0 0 auto;}
.leader-me-divider{margin:18px 0 8px;font-size:.7rem;font-weight:900;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);text-align:center;}
.leader-me-row{box-shadow:0 8px 18px rgba(124,58,237,.2);}

@media (max-width:560px){
  .leaderboard-podium{gap:5px;}
  .podium-1 .podium-avatar{width:64px;height:64px;}
  .podium-2 .podium-avatar,.podium-3 .podium-avatar{width:50px;height:50px;}
  .podium-name{font-size:.76rem;}
}

/* Podium/list avatar circles render correctly for both image and initials */
.podium-avatar,.leader-row-avatar{
  border-radius:50%;overflow:hidden;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--purple));color:#fff;
  font-weight:800;font-size:.8rem;line-height:1;
}
.podium-avatar img,.leader-row-avatar img{width:100%;height:100%;object-fit:cover;}

/* ── Store reward icons (emoji + chibi-Noa memoji images) ──────────────────── */
/* Centered store cards: icon on top, title + description centered, no boxes/tags */
.store-item-top{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;}
.store-item h2{text-align:center;}
.store-item p{text-align:center;}
.store-icon{display:grid;place-items:center;}
/* Circular icon with a purple gradient ring */
.store-icon-img{
  width:96px;height:96px;border-radius:50%;padding:3px;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  box-shadow:0 6px 16px rgba(124,58,237,.22);
}
.store-icon-img img{width:100%;height:100%;border-radius:50%;object-fit:cover;background:#fff;display:block;}
.store-icon-emoji{
  width:96px;height:96px;border-radius:50%;display:grid;place-items:center;
  font-size:2.7rem;line-height:1;
  background:radial-gradient(circle at 50% 40%,#f5f3ff,#ede9fe);
  border:3px solid transparent;
  background-image:radial-gradient(circle at 50% 40%,#f5f3ff,#ede9fe),linear-gradient(135deg,var(--brand),var(--purple));
  background-origin:border-box;background-clip:content-box,border-box;
  box-shadow:0 6px 16px rgba(124,58,237,.22);
}
.store-item-bottom{justify-content:center;gap:14px;}
@media (max-width:560px){.store-icon-img,.store-icon-emoji{width:84px;height:84px;}.store-icon-emoji{font-size:2.4rem;}}

/* ── Noa dashboard: store redemptions ──────────────────────────────────────── */
.noa-pending-badge{display:inline-block;background:#fef3c7;color:#b45309;border:1px solid #fde68a;border-radius:999px;padding:2px 9px;font-size:.7rem;font-weight:800;vertical-align:middle;margin-left:6px;}
.noa-redeem-list{display:flex;flex-direction:column;gap:8px;margin-bottom:8px;}
.noa-redeem-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;border-radius:14px;background:rgba(255,255,255,.6);border:1px solid var(--glass-border);}
.noa-redeem-item.is-pending{background:rgba(250,204,21,.10);border-color:rgba(250,204,21,.4);}
.noa-redeem-info{display:flex;flex-direction:column;gap:2px;min-width:0;}
.noa-redeem-info strong{font-size:.92rem;}
.noa-redeem-member{font-size:.8rem;color:var(--ink);}
.noa-redeem-email{color:var(--brand);font-weight:700;}
.noa-redeem-toggle{flex:0 0 auto;padding:.5rem .8rem!important;font-size:.8rem!important;border-radius:10px!important;}

/* ── Onboarding survey answers ─────────────────────────────────────────────── */
.noa-onb-list{display:flex;flex-direction:column;gap:8px;margin-bottom:8px;}
.noa-onb-item{padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.6);border:1px solid var(--glass-border);display:flex;flex-direction:column;gap:8px;}
.noa-onb-item.is-new{background:rgba(124,58,237,.07);border-color:rgba(124,58,237,.35);}
.noa-onb-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.noa-onb-head strong{font-size:.92rem;display:flex;align-items:center;gap:7px;}
.noa-onb-newdot{background:var(--brand);color:#fff;border-radius:999px;padding:1px 7px;font-size:.62rem;font-weight:900;letter-spacing:.04em;}
.noa-onb-answers{display:flex;flex-direction:column;gap:5px;}
.noa-onb-answer{display:flex;gap:8px;align-items:baseline;}
.noa-onb-q{flex:0 0 110px;font-size:.74rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);}
.noa-onb-a{font-size:.9rem;color:var(--ink);font-weight:600;}
@media (max-width:560px){
  .noa-onb-answer{flex-direction:column;gap:1px;}
  .noa-onb-q{flex:none;}
}

/* ── Members management ────────────────────────────────────────────────────── */
.noa-member-list{display:flex;flex-direction:column;gap:6px;margin-bottom:8px;max-height:520px;overflow-y:auto;padding-right:2px;}
.noa-member-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 12px;border-radius:13px;background:rgba(255,255,255,.6);border:1px solid var(--glass-border);}
.noa-member-info{display:flex;align-items:center;gap:10px;min-width:0;}
.noa-member-avatar{width:38px;height:38px;flex:0 0 auto;font-size:.85rem;}
.noa-member-text{display:flex;flex-direction:column;gap:1px;min-width:0;}
.noa-member-text strong{font-size:.9rem;display:flex;align-items:center;gap:6px;}
.noa-member-admin{background:#7c3aed;color:#fff;border-radius:999px;padding:1px 7px;font-size:.6rem;font-weight:900;letter-spacing:.04em;}
.noa-member-delete{flex:0 0 auto;padding:.4rem .75rem!important;font-size:.78rem!important;border-radius:10px!important;color:#dc2626!important;border-color:rgba(220,38,38,.35)!important;}
.noa-member-delete:hover{background:rgba(220,38,38,.08)!important;}

/* ── Noa dashboard tabs ────────────────────────────────────────────────────── */
.noa-tabs{display:flex;gap:6px;overflow-x:auto;padding:2px 0 12px;margin-bottom:6px;-webkit-overflow-scrolling:touch;scrollbar-width:none;}
.noa-tabs::-webkit-scrollbar{display:none;}
.noa-tab{flex:0 0 auto;border:1px solid var(--glass-border);background:rgba(255,255,255,.6);color:var(--muted);border-radius:999px;padding:8px 15px;font-size:.84rem;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:all .12s;}
.noa-tab:hover{color:var(--ink);}
.noa-tab.active{background:var(--brand);color:#fff;border-color:var(--brand);}
.noa-tab-badge{background:rgba(17,24,39,.12);border-radius:999px;padding:0 7px;font-size:.7rem;font-weight:900;line-height:1.5;}
.noa-tab.active .noa-tab-badge{background:rgba(255,255,255,.32);}
.noa-tab-panel{display:none;}
.noa-tab-panel.active{display:block;}

/* ── Guess-it answer unlock ────────────────────────────────────────────────── */
.answer-lock{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0;padding:12px 14px;border-radius:14px;background:linear-gradient(135deg,rgba(124,58,237,.08),rgba(124,58,237,.03));border:1px dashed rgba(124,58,237,.4);}
.answer-lock-msg{font-size:.9rem;color:#4b5563;min-width:0;}
.answer-unlock-btn{flex:0 0 auto;border:0;background:var(--brand);color:#fff;border-radius:11px;padding:9px 16px;font-weight:800;font-size:.85rem;cursor:pointer;}
.answer-unlock-btn:hover{filter:brightness(1.05);}
.answer-lock.revealed{display:block;background:#f5f3ff;border:1px solid #ddd6fe;border-style:solid;animation:fadeIn .2s ease;}
@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}
.answer-reveal-label{font-size:.74rem;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:var(--brand-dark,#5b21b6);margin-bottom:8px;}
.answer-reveal-body{font-size:1rem;line-height:1.65;color:#111827;white-space:pre-wrap;overflow-wrap:anywhere;}

/* ── Saved posts on profile ────────────────────────────────────────────────── */
.profile-saved-list{display:flex;flex-direction:column;gap:6px;}
.profile-saved-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:rgba(255,255,255,.6);border:1px solid var(--glass-border);border-radius:12px;padding:9px 12px;cursor:pointer;font:inherit;transition:border-color .12s;}
.profile-saved-item:hover{border-color:var(--brand);}
.profile-saved-cat{flex:0 0 auto;font-size:.68rem;font-weight:800;}
.profile-saved-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;font-size:.9rem;color:var(--ink);}
.profile-saved-meta{flex:0 0 auto;font-size:.74rem;color:var(--muted);white-space:nowrap;}

/* ── Default "zoomed-out" look on desktop (≈80%), so the UI isn't too big/close.
   Mobile is left at native scale since it's already responsive. ───────────── */
@media (min-width: 761px) {
  html { zoom: 0.8; }
}

/* ── Interactive feature tour ──────────────────────────────────────────────── */
.tour-overlay{position:fixed;inset:0;z-index:3000;pointer-events:auto;}
.tour-overlay.no-spot{background:rgba(2,6,23,.74);}
.tour-spotlight{position:fixed;border-radius:16px;border:2px solid rgba(168,85,247,.95);box-shadow:0 0 0 9999px rgba(2,6,23,.74),0 0 22px 4px rgba(168,85,247,.55);transition:all .28s cubic-bezier(.4,0,.2,1);pointer-events:none;}
.tour-tooltip{position:fixed;z-index:3001;max-width:340px;width:calc(100vw - 28px);background:#fff;border-radius:18px;padding:18px;box-shadow:0 24px 60px rgba(2,6,23,.45);transition:left .25s,top .25s;animation:tourPop .25s ease;}
.tour-tooltip.centered{left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;max-width:400px;}
@keyframes tourPop{from{opacity:0;transform:translateY(6px) scale(.97);}to{opacity:1;}}
.tour-tooltip.centered{animation:tourPopCenter .28s ease;}
@keyframes tourPopCenter{from{opacity:0;transform:translate(-50%,-46%) scale(.97);}to{opacity:1;transform:translate(-50%,-50%) scale(1);}}
.tour-emoji{font-size:1.7rem;line-height:1;display:inline-block;}
.tour-step-count{font-size:.7rem;font-weight:900;letter-spacing:.07em;color:var(--brand);text-transform:uppercase;margin-bottom:8px;}
.tour-title{margin:8px 0 6px;font-size:1.18rem;font-weight:900;letter-spacing:-.02em;color:#0f172a;}
.tour-body{margin:0;font-size:.92rem;line-height:1.55;color:#475569;}
.tour-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:16px;}
.tour-nav{display:flex;gap:8px;}
.tour-skip{background:none;border:0;color:#94a3b8;font-weight:700;font-size:.84rem;cursor:pointer;padding:6px 2px;}
.tour-skip:hover{color:#64748b;}
.tour-back{background:#f1f5f9;color:#475569;border:0;border-radius:11px;padding:9px 15px;font-weight:800;font-size:.86rem;cursor:pointer;}
.tour-next{background:var(--brand);color:#fff;border:0;border-radius:11px;padding:9px 20px;font-weight:800;font-size:.86rem;cursor:pointer;}
.tour-next:hover{filter:brightness(1.05);}
.tour-dots{display:flex;gap:5px;justify-content:center;margin-top:14px;}
.tour-dot{width:6px;height:6px;border-radius:50%;background:#cbd5e1;transition:all .2s;}
.tour-dot.active{background:var(--brand);width:18px;border-radius:3px;}
.tour-intro-textarea{width:100%;box-sizing:border-box;border:1px solid var(--ring);border-radius:14px;padding:12px 14px;font-family:inherit;font-size:.95rem;line-height:1.5;min-height:108px;resize:vertical;margin-top:14px;}
.tour-intro-textarea:focus{outline:none;border-color:var(--brand);}
.tour-intro-actions{display:flex;align-items:center;gap:10px;margin-top:14px;}
.tour-intro-actions .tour-next{flex:1;text-align:center;padding:11px 20px;}
@media (max-width:600px){.tour-tooltip{max-width:none;}}

/* ── Store redeem confirm modal ────────────────────────────────────────────── */
.redeem-confirm-dialog{max-width:380px;text-align:center;}
.redeem-confirm-emoji{font-size:2.6rem;line-height:1;margin-bottom:6px;}
.redeem-confirm-reward{font-weight:800;color:var(--brand-dark);margin:.2rem 0 1rem;font-size:1.02rem;}
.redeem-confirm-note{color:var(--muted);font-size:.88rem;margin:0 0 .35rem;}
.redeem-confirm-email{font-weight:800;color:var(--brand);font-size:.95rem;margin:0 0 1.2rem;word-break:break-all;}
.redeem-confirm-actions{display:flex;gap:10px;}
.redeem-confirm-actions button{flex:1;}

/* Full-page onboarding before signup */
body.join-flow-active{background:#f7f3ff;}
body.join-flow-active .quick-menu-wrap{display:none;}
.join-page-view{width:100%;min-height:calc(100dvh - 55px);}
.join-flow-page{
  min-height:calc(100dvh - 55px);
  display:grid;
  place-items:center;
  padding:28px 16px 44px;
  background:
    radial-gradient(circle at 14% 18%, rgba(250,204,21,.18), transparent 30%),
    radial-gradient(circle at 86% 20%, rgba(124,58,237,.14), transparent 34%),
    linear-gradient(135deg,#fffaf2 0%,#f7f3ff 54%,#eef2ff 100%);
}
.join-flow-card{
  width:min(100%,1060px);
  min-height:min(690px,calc(100dvh - 108px));
  position:relative;
  overflow:hidden;
  border:1px solid rgba(124,58,237,.18);
  border-radius:28px;
  background:rgba(255,255,255,.9);
  box-shadow:0 30px 90px rgba(79,70,229,.2);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
}
.join-flow-card::before{
  content:'桜';
  position:absolute;
  right:22px;
  bottom:10px;
  color:rgba(124,58,237,.045);
  font-size:9rem;
  font-weight:950;
  line-height:1;
  pointer-events:none;
}
.join-flow-progress{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px 22px 0;
}
.join-progress-track{
  flex:1;
  height:9px;
  overflow:hidden;
  border-radius:999px;
  background:#ede9fe;
}
#joinProgressFill{
  display:block;
  width:14.28%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--brand),var(--purple));
  transition:width .28s ease;
}
#joinStepLabel{
  color:#6b7280;
  font-size:.82rem;
  font-weight:950;
  white-space:nowrap;
}
.join-flow-slides{position:relative;z-index:1;min-height:0;}
.join-flow-slide{
  display:none;
  min-height:100%;
  grid-template-columns:minmax(0,1.04fr) minmax(300px,.82fr);
  gap:24px;
  align-items:center;
  padding:26px 28px 18px;
}
.join-flow-slide.active{
  display:grid;
  animation:joinSlideIn .26s cubic-bezier(.2,.8,.2,1);
}
.join-flow-copy{
  min-width:0;
  display:grid;
  gap:16px;
  align-content:center;
}
.join-kicker{
  color:var(--brand);
  font-size:.78rem;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.join-flow-copy h1,
.join-flow-copy h2,
.join-question-card h2{
  margin:0;
  color:#21183f;
  font-size:clamp(2.15rem,5vw,4.45rem);
  line-height:.98;
  letter-spacing:0;
}
.join-flow-copy h2,
.join-question-card h2{font-size:clamp(2rem,4vw,3.25rem);}
.join-flow-copy p{
  margin:0;
  max-width:660px;
  color:#374151;
  font-size:1.02rem;
  font-weight:800;
  line-height:1.65;
}
.join-message-list{
  display:grid;
  gap:8px;
  max-width:520px;
  color:#312e81;
  font-weight:900;
}
.join-message-list span{
  position:relative;
  padding-left:18px;
  color:#1f2937;
}
.join-message-list span::before{
  content:'-';
  position:absolute;
  left:0;
  color:var(--brand);
}
.join-flow-copy em{
  color:#4f46e5;
  font-weight:950;
  font-size:1.08rem;
}
.join-flow-visual{
  min-height:430px;
  border:1px solid rgba(124,58,237,.14);
  border-radius:24px;
  overflow:hidden;
  background:#f8f7ff;
  box-shadow:0 18px 50px rgba(17,24,39,.1);
}
.join-flow-visual img{
  width:100%;
  height:100%;
  min-height:430px;
  display:block;
  object-fit:cover;
}
.join-price-panel{
  display:grid;
  align-content:center;
  gap:16px;
  min-height:430px;
  border:1px solid rgba(124,58,237,.16);
  border-radius:24px;
  padding:26px;
  background:linear-gradient(180deg,#fff,#f6f2ff);
  box-shadow:0 18px 50px rgba(17,24,39,.1);
  text-align:center;
}
.join-value-label{
  color:#6b7280;
  font-size:.78rem;
  font-weight:950;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.join-value-price{
  justify-self:center;
  color:#9ca3af;
  font-size:3.35rem;
  font-weight:950;
  line-height:1;
  text-decoration:line-through;
  text-decoration-color:#ef4444;
  text-decoration-thickness:5px;
}
.join-real-price{line-height:1;}
.join-real-price span{
  font-size:4.5rem;
  font-weight:950;
  background:linear-gradient(135deg,#7c3aed,#4f46e5);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.join-real-price small{
  display:block;
  margin-top:7px;
  color:#4b5563;
  font-weight:950;
}
.join-price-panel p{
  margin:0;
  color:#6b7280;
  font-weight:800;
}
.join-value-breakdown{
  display:grid;
  gap:10px;
  max-width:560px;
}
.join-value-breakdown div{
  display:flex;
  justify-content:space-between;
  gap:12px;
  border:1px solid rgba(124,58,237,.14);
  border-radius:15px;
  padding:11px 13px;
  background:#fff;
  color:#1f2937;
  font-weight:900;
}
.join-value-breakdown b{color:#4f46e5;}
.join-feature-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.join-feature-grid article{
  border:1px solid rgba(124,58,237,.14);
  border-radius:18px;
  padding:15px;
  background:#fff;
  box-shadow:0 10px 26px rgba(17,24,39,.05);
}
.join-feature-grid span{
  display:inline-flex;
  margin-bottom:9px;
  border-radius:999px;
  background:#f3e8ff;
  color:#6d28d9;
  padding:4px 9px;
  font-size:.72rem;
  font-weight:950;
}
.join-feature-grid strong{
  display:block;
  color:#111827;
  line-height:1.35;
}
.join-question-slide{
  grid-template-columns:minmax(0,760px);
  justify-content:center;
}
.join-question-card{
  display:grid;
  gap:22px;
  width:100%;
  border:1px solid rgba(124,58,237,.14);
  border-radius:26px;
  background:linear-gradient(180deg,#fff,#faf8ff);
  padding:34px;
  box-shadow:0 18px 54px rgba(17,24,39,.09);
}
.join-question-card.needs-answer{
  border-color:#f59e0b;
  box-shadow:0 0 0 5px rgba(245,158,11,.16),0 18px 54px rgba(17,24,39,.09);
}
.join-answer-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.join-answer-row button{
  min-height:58px;
  border:1px solid rgba(79,70,229,.18);
  border-radius:16px;
  background:#fff;
  color:#312e81;
  padding:.85rem 1rem;
  font-weight:950;
  text-align:left;
  transition:transform .18s ease,background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.join-answer-row button:hover{
  transform:translateY(-1px);
  background:#f5f3ff;
}
.join-answer-row button.selected{
  border-color:transparent;
  background:linear-gradient(135deg,var(--brand),var(--purple));
  color:#fff;
  box-shadow:0 12px 26px rgba(79,70,229,.22);
}
.join-final-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,210px));
  gap:10px;
  margin-top:4px;
}
.join-final-actions button{width:100%;}
.join-flow-footer{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:16px;
  align-items:center;
  padding:0 22px 22px;
}
.join-dots{
  display:flex;
  justify-content:center;
  gap:8px;
}
.join-dot{
  width:9px;
  height:9px;
  border:0;
  border-radius:999px;
  background:#ddd6fe;
  padding:0;
}
.join-dot.active{
  width:26px;
  background:linear-gradient(135deg,var(--brand),var(--purple));
}
.join-flow-footer .secondary-btn[disabled]{
  opacity:.45;
  cursor:not-allowed;
}
@keyframes joinSlideIn{
  from{opacity:0;transform:translateY(10px);}
  to{opacity:1;transform:translateY(0);}
}
@media (max-width:860px){
  .join-flow-page{display:block;padding:16px 12px 90px;}
  .join-flow-card{min-height:calc(100dvh - 85px);border-radius:22px;}
  .join-flow-slide,.join-flow-slide.active{grid-template-columns:1fr;padding:20px 18px 14px;}
  .join-flow-copy h1{font-size:2.65rem;}
  .join-flow-copy h2,.join-question-card h2{font-size:2.2rem;}
  .join-flow-visual,.join-flow-visual img,.join-price-panel{min-height:260px;}
  .join-question-card{padding:24px;}
  .join-answer-row{grid-template-columns:1fr;}
  .join-feature-grid{grid-template-columns:1fr;}
  .join-flow-footer{grid-template-columns:1fr 1fr;padding:0 18px 18px;}
  .join-dots{grid-column:1 / -1;grid-row:1;}
  .join-final-actions{grid-template-columns:1fr;}
}
@media (max-width:520px){
  .join-flow-progress{padding:14px 14px 0;}
  .join-flow-slide,.join-flow-slide.active{padding:18px 14px 12px;}
  .join-flow-copy{gap:13px;}
  .join-flow-copy h1{font-size:2.15rem;}
  .join-flow-copy h2,.join-question-card h2{font-size:1.8rem;}
  .join-flow-copy p{font-size:.94rem;line-height:1.55;}
  .join-question-card{border-radius:20px;padding:18px;gap:16px;}
  .join-real-price span{font-size:3.25rem;}
  .join-value-price{font-size:2.4rem;}
  .join-flow-footer{gap:10px;padding:0 14px 14px;}
}

/* Loading skeletons */
.skeleton-card,.skeleton-row,.skeleton-tile{position:relative;overflow:hidden;}
.skeleton-card{display:grid;gap:12px;}
.skeleton-head{display:flex;align-items:center;gap:12px;}
.skeleton-lines{display:grid;gap:8px;flex:1;min-width:0;}
.skeleton-line,.skeleton-avatar,.skeleton-pill,.skeleton-actions span,.skeleton-tile{
  background:linear-gradient(90deg,#eef2ff 0%,#f8fafc 45%,#e9e7ff 75%,#eef2ff 100%);
  background-size:220% 100%;
  animation:skeleton-shimmer 1.25s ease-in-out infinite;
}
.skeleton-line{display:block;height:12px;border-radius:999px;width:100%;}
.skeleton-line.title{height:22px;width:62%;}
.skeleton-line.medium{width:70%;}
.skeleton-line.short{width:44%;}
.skeleton-line.tiny{width:26%;}
.skeleton-avatar{width:46px;height:46px;border-radius:999px;flex:0 0 auto;}
.skeleton-avatar.small{width:34px;height:34px;}
.skeleton-avatar.large{width:74px;height:74px;margin:0 auto;}
.skeleton-pill{width:108px;height:28px;border-radius:999px;flex:0 0 auto;}
.skeleton-actions{display:flex;gap:10px;border-top:1px solid var(--ring);padding-top:12px;}
.skeleton-actions span{width:54px;height:28px;border-radius:999px;}
.skeleton-list{display:grid;gap:10px;}
.skeleton-row{display:flex;align-items:center;gap:10px;border:1px solid var(--ring);border-radius:16px;padding:12px;background:#fff;}
.skeleton-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;width:100%;}
.skeleton-tile{min-height:150px;border:1px solid var(--ring);border-radius:18px;padding:18px;display:grid;align-content:center;gap:12px;background-color:#fff;}
@keyframes skeleton-shimmer{0%{background-position:120% 0;}100%{background-position:-120% 0;}}
@media (prefers-reduced-motion:reduce){.skeleton-line,.skeleton-avatar,.skeleton-pill,.skeleton-actions span,.skeleton-tile{animation:none;}}

/* Account recovery, legal docs, saved posts, and moderation */
.auth-link-btn{border:0;background:transparent;color:var(--brand);font-weight:900;padding:8px 4px 0;cursor:pointer;text-align:center;}
.auth-link-btn:hover{text-decoration:underline;}
.legal-footer{position:relative;z-index:1;display:flex;justify-content:center;gap:14px;flex-wrap:wrap;max-width:1040px;margin:8px auto 28px;padding:0 16px;color:var(--muted);}
.legal-footer button{border:0;background:transparent;color:var(--muted);font-weight:800;font-size:.82rem;cursor:pointer;padding:4px 6px;}
.legal-footer button:hover{color:var(--brand);text-decoration:underline;}
.legal-dialog{width:min(100%,620px);}
.legal-content{display:grid;gap:12px;color:#374151;line-height:1.62;}
.legal-content h3{margin:8px 0 0;font-size:1rem;color:#111827;}
.legal-content p{margin:0;}
.bookmark-btn.saved{color:var(--brand);background:#eef2ff;}
/* Save + commenter avatars sit with like/comment on the left; report alone on the right corner — same on desktop and phone. */
.post-actions .report-post-btn{margin-left:auto;}
.report-post-btn{font-size:.9rem!important;color:#9ca3af!important;border:1px solid transparent!important;}
.report-post-btn:hover,.comment-report-btn:hover{color:#b45309!important;background:#fffbeb!important;}
.comment-report-btn{border:0;background:transparent;color:#9ca3af;font-weight:800;font-size:.76rem;padding:2px 4px;cursor:pointer;border-radius:8px;}
.noa-stat-card.compact{min-height:84px;}
.noa-category-list,.noa-report-list{display:grid;gap:8px;margin-bottom:18px;}
.noa-category-list{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}
.noa-category-list div{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--ring);background:#fff;border-radius:14px;padding:10px 12px;font-weight:900;}
.noa-category-list span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#374151;font-size:.86rem;}
.noa-report-item,.dash-report-item{border:1px solid var(--ring);background:#fff;border-radius:16px;padding:12px;display:grid;gap:10px;}
.noa-report-item.is-muted{opacity:.72;background:#f9fafb;}
.noa-report-info{display:grid;gap:4px;min-width:0;}
.noa-report-info p{margin:0;color:#92400e;font-weight:800;font-size:.86rem;}
.noa-report-excerpt{display:block;color:#4b5563;font-size:.84rem;line-height:1.45;background:#f9fafb;border-radius:10px;padding:8px;overflow-wrap:anywhere;}
.noa-report-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.noa-report-actions button{padding:.5rem .75rem;font-size:.78rem;}
.dash-report-item strong{font-size:.88rem;}
@media (max-width:760px){.legal-footer{padding-bottom:72px;}.noa-report-actions{display:grid;grid-template-columns:1fr 1fr;}.noa-report-actions button{width:100%;}}

/* Desktop: wrap category chips so all post types are visible (no hidden scroll).
   Mobile keeps the single-row swipe scroll. */
@media (min-width:761px){
  .category-card .chips{flex-wrap:wrap;overflow-x:visible;}
}

/* ── Onboarding refresh: smaller titles, feature emoji grid, price, Other ──── */
.join-flow-copy h1,
.join-question-card h2{font-size:clamp(1.7rem,3.4vw,2.7rem)!important;line-height:1.08!important;}
.join-flow-copy h2{font-size:clamp(1.5rem,3vw,2.2rem)!important;line-height:1.1!important;}
.join-flow-copy p{font-size:1rem;line-height:1.55;}

/* Feature grid as emoji cards */
.join-features-copy .join-feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:6px;}
.join-feature-grid article{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.7);border:1px solid var(--glass-border);}
.join-feature-grid article span{font-size:1.5rem;line-height:1;flex:0 0 auto;}
.join-feature-grid article strong{font-size:.9rem;font-weight:800;color:var(--ink);}

/* Inline price on the final slide */
.join-price-inline{display:flex;align-items:baseline;gap:8px;margin-top:4px;}
.join-price-inline b{font-family:Poppins,Inter,sans-serif;font-size:2.4rem;font-weight:900;background:linear-gradient(135deg,var(--brand),var(--purple));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;}
.join-price-inline small{color:var(--muted);font-weight:800;font-size:.85rem;}

/* "Other" free-text input under answers */
.join-other-input{margin-top:10px;width:100%;max-width:420px;border:1.5px solid var(--brand);border-radius:12px;padding:.7rem .9rem;font-size:.95rem;}
.join-other-input.hidden{display:none!important;}

/* Phone: stack copy over visual, smaller everything, scrollable */
@media (max-width:760px){
  .join-flow-slide{grid-template-columns:1fr!important;gap:16px;padding:20px 18px 14px;align-content:start;}
  .join-flow-copy{gap:12px;}
  .join-flow-copy h1,.join-question-card h2{font-size:clamp(1.55rem,7vw,2rem)!important;}
  .join-flow-copy h2{font-size:clamp(1.4rem,6vw,1.8rem)!important;}
  .join-flow-copy p{font-size:.95rem;}
  .join-flow-visual{min-height:200px;order:-1;}     /* image on top on mobile */
  .join-flow-visual img{max-height:240px;width:auto;margin:0 auto;}
  .join-question-slide .join-flow-visual{display:none;}
  .join-features-copy .join-feature-grid{grid-template-columns:1fr;}
  .join-answer-row{grid-template-columns:1fr!important;}
  .join-price-inline b{font-size:2rem;}
}

/* Final slide: centered pricing finale with the big gradient price */
.join-flow-slide.join-final-slide.active{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;gap:14px;
}
.join-final-slide .join-flow-visual{order:-1;width:auto;min-height:auto!important;border:none;background:none;box-shadow:none;overflow:visible;}
.join-final-slide .join-flow-visual img{min-height:0!important;height:auto!important;width:auto!important;max-height:210px;object-fit:contain!important;margin:0 auto;display:block;}
.join-final-slide .join-flow-copy{align-items:center;max-width:600px;gap:12px;}
.join-final-slide .join-flow-copy p{margin:0 auto;}
.join-final-slide .join-price-inline{justify-content:center;margin-top:2px;}
.join-final-slide .join-price-inline b{font-size:3.4rem;}
.join-final-slide .join-final-actions{justify-content:center;flex-wrap:wrap;}
@media (max-width:760px){
  .join-final-slide .join-flow-visual{width:150px;}
  .join-final-slide .join-flow-visual img{max-height:150px;}
  .join-final-slide .join-price-inline b{font-size:2.6rem;}
}
