/* ==========================================================
   Campus Connect — shared color tokens
   Brand colors (primary/accent/success) stay IDENTICAL across
   light and dark mode, and match the Android colors.xml exactly.
   Only background/surface/text/border shift between themes.
   Source of truth: colors.md
   ========================================================== */
:root{
  --primary: #243B6B;      /* Navy         — colorPrimary in the app */
  --primary-dark: #182747; /* Pressed/hover, status bar, footer */
  --accent: #FF6B45;       /* Orange       — colorAccent in the app */
  --accent-dark: #E0532B;
  --success: #2E9E6E;      /* Green        — verified / ratings */

  /* Light theme (default) */
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --text: #1D1B16;
  --text-muted: #6B6558;
  --border: #E4E1D8;
  --error: #C1432E;
  --hero-overlay: linear-gradient(180deg, rgba(36,59,107,0.55) 0%, rgba(36,59,107,0.75) 100%);

  --radius: 10px;
  --transition-theme: background .25s ease, color .25s ease, border-color .25s ease;
}

[data-theme="dark"]{
  --bg: #12181C;
  --surface: #1B242A;
  --text: #F2F0EA;
  --text-muted: #9DA8A3;
  --border: #2C3941;
  --hero-overlay: linear-gradient(180deg, rgba(15,22,32,0.65) 0%, rgba(15,22,32,0.88) 100%);
}

*{box-sizing:border-box;margin:0;padding:0;}
html{color-scheme: light dark;}
body{
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
  transition: var(--transition-theme);
}

/* Startup splash */
.startup-splash{
  position:fixed;inset:0;z-index:1000;
  display:grid;place-items:center;
  background:var(--surface);
  opacity:1;
  transition:opacity .35s ease, visibility .35s ease;
}
.startup-splash.is-leaving{opacity:0;visibility:hidden;pointer-events:none;}
.startup-splash-inner{text-align:center;}
.startup-splash-logo{
  width:192px;height:192px;object-fit:contain;
  animation:splash-logo-in .8s cubic-bezier(.2,.9,.3,1.2) both;
}
.startup-splash-name{
  margin-top:0;color:var(--primary);
  font-size:1.35rem;font-weight:800;letter-spacing:.02em;
  animation:splash-name-in .45s ease .42s both;
}
.startup-splash-name span{color:var(--accent);}
@keyframes splash-logo-in{
  from{opacity:0;transform:scale(0)}
  to{opacity:1;transform:scale(1)}
}
@keyframes splash-name-in{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@media (prefers-reduced-motion: reduce){
  .startup-splash-logo,.startup-splash-name{animation:none;}
  .startup-splash{transition:none;}
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}

.container{max-width:1140px;margin:0 auto;padding:0 24px;}

/* Buttons */
.btn{
  display:inline-block;
  padding:13px 26px;
  border-radius:8px;
  font-weight:600;
  font-size:0.95rem;
  border:2px solid transparent;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary{background:var(--primary);color:#fff;}
.btn-primary:hover{background:var(--primary-dark);transform:translateY(-1px);}
.btn-accent{background:var(--accent);color:#fff;}
.btn-accent:hover{background:var(--accent-dark);}
.btn-outline{background:transparent;color:var(--primary);border-color:var(--primary);}
.btn-outline:hover{background:var(--primary);color:#fff;}
[data-theme="dark"] .btn-outline{color:#fff;border-color:rgba(255,255,255,0.5);}
[data-theme="dark"] .btn-outline:hover{background:rgba(255,255,255,0.12);}

/* Header */
.site-header{
  background:color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:20;
  transition: var(--transition-theme),transform .25s ease;
}
.site-header.is-hidden{transform:translateY(-100%);}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;
  min-height:72px;
  padding:4px 24px;
}
.logo{display:inline-flex;align-items:center;gap:9px;font-weight:800;font-size:1.2rem;letter-spacing:-0.04em;color:var(--primary);}
.logo-mark{width:64px;height:64px;object-fit:contain;flex:0 0 64px;}
.logo-wordmark{display:inline-block;}
[data-theme="dark"] .logo{color:#fff;}
.logo-wordmark > span{color:var(--accent);}
.nav-links{display:flex;gap:28px;font-weight:600;font-size:0.92rem;}
.nav-links a:hover{color:var(--accent);}
.header-actions{display:flex;align-items:center;gap:16px;}
.nav-cta{padding:10px 20px;font-size:0.88rem;}
.profile-menu-wrap{position:relative;}
.profile-menu-button{display:flex;flex-direction:column;justify-content:center;gap:4px;width:40px;height:40px;padding:9px;border:1px solid var(--border);border-radius:50%;background:var(--bg);color:var(--text);cursor:pointer;}
.profile-menu-button span{display:block;width:20px;height:2px;border-radius:2px;background:currentColor;transition:transform .2s ease,opacity .2s ease;}
.profile-menu-button[aria-expanded="true"] span:nth-child(1){transform:translateY(6px) rotate(45deg);}
.profile-menu-button[aria-expanded="true"] span:nth-child(2){opacity:0;}
.profile-menu-button[aria-expanded="true"] span:nth-child(3){transform:translateY(-6px) rotate(-45deg);}
.profile-menu{position:absolute;top:48px;right:0;z-index:40;min-width:150px;padding:6px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:0 14px 30px rgba(15,22,32,.18);}
.profile-menu[hidden]{display:none;}
.profile-menu button{display:block;width:100%;padding:10px 12px;border:0;border-radius:7px;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer;}
.profile-menu button:hover{background:var(--bg);color:var(--accent);}

.theme-toggle{
  width:40px;height:40px;border-radius:50%;
  border:1px solid var(--border);
  background:var(--bg);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  transition: var(--transition-theme);
}
.theme-toggle:hover{border-color:var(--accent);}
.theme-icon{font-size:1rem;line-height:1;}
.theme-icon-moon{display:none;}
[data-theme="dark"] .theme-icon-sun{display:none;}
[data-theme="dark"] .theme-icon-moon{display:inline;}

@media (max-width:760px){
  .nav-links{display:none;}
}
@media (max-width:420px){
  .header-actions .nav-cta:last-child{display:none;}
}

/* Hero — full-bleed video background */
.hero{padding:64px 0;position:relative;}
.hero-video{
  padding:104px 0 116px;
  overflow:hidden;
  min-height:620px;
  display:flex;align-items:center;
}
.hero-video-bg{
  position:absolute;inset:0;
  overflow:hidden;
  z-index:0;
}
.hero-video-el{
  position:absolute;top:50%;left:50%;
  min-width:100%;min-height:100%;
  width:auto;height:auto;
  transform:translate(-50%,-50%);
  object-fit:cover;
}
.hero-video-overlay{
  position:absolute;inset:0;
  background:linear-gradient(90deg, rgba(15,25,42,0.9) 0%, rgba(15,25,42,0.7) 52%, rgba(15,25,42,0.48) 100%), var(--hero-overlay);
  transition:background .25s ease;
}
.hero-video .hero-inner{position:relative;z-index:1;}

/* Video is heavy on mobile data/battery — fall back to the poster image only */
@media (max-width:760px){
  .hero-video-el{display:none;}
  .hero-video-bg{background:url('assets/hero-poster.jpg') center/cover no-repeat;}
}
@media (prefers-reduced-motion: reduce){
  .hero-video-el{display:none;}
  .hero-video-bg{background:url('assets/hero-poster.jpg') center/cover no-repeat;}
}

.hero-inner{
  display:grid;grid-template-columns:minmax(0,1.05fr) minmax(280px,0.75fr);gap:64px;align-items:center;
}
@media (max-width:860px){ .hero-inner{grid-template-columns:1fr;} }

.badge{
  display:inline-block;background:rgba(46,158,110,0.18);color:#fff;
  font-weight:700;font-size:0.78rem;padding:6px 14px;border-radius:999px;
  margin-bottom:18px;transition:opacity .25s ease,transform .25s ease;
}
.badge.is-hidden{opacity:0!important;visibility:hidden;transform:translateY(-8px);pointer-events:none;}
.hero-video .hero-text h1{
  color:#fff;
  max-width:18ch;
  font-size:clamp(2.25rem,4vw,3.6rem);
  line-height:1.12;
  margin-bottom:18px;
  text-shadow:0 2px 12px rgba(0,0,0,0.25);
}
.hero-video .hero-text p{
  color:rgba(255,255,255,0.9);
  font-size:1.05rem;max-width:48ch;margin-bottom:28px;
}
.hero-ctas{display:flex;gap:14px;flex-wrap:wrap;}
.hero-video .btn-outline{
  background:transparent;color:#fff;border-color:rgba(255,255,255,0.7);
}
.hero-video .btn-outline:hover{background:rgba(255,255,255,0.12);border-color:#fff;}

@media (max-width:560px){
  .hero-ctas{flex-direction:column;}
  .hero-ctas .btn{width:100%;text-align:center;white-space:nowrap;}
}

.hero-card{display:flex;justify-content:center;}
.phone-mock{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:24px;
  width:280px;
  padding:28px 18px 18px;
  box-shadow:0 20px 40px rgba(0,0,0,0.25);
  transition: var(--transition-theme);
}
.phone-notch{width:60px;height:6px;background:var(--border);border-radius:4px;margin:0 auto 20px;}
.phone-item{
  background:var(--bg);
  border-radius:var(--radius);
  padding:14px;margin-bottom:12px;
  border:1px solid var(--border);
}
    padding:28px 18px 18px;
    transform:rotate(2deg);
.phone-item p{font-size:0.82rem;color:var(--text-muted);}
.pill{
  display:inline-block;font-size:0.68rem;font-weight:700;
  padding:3px 9px;border-radius:999px;
}
.pill-green{background:rgba(46,158,110,0.15);color:var(--success);}
.pill-orange{background:rgba(255,107,69,0.15);color:var(--accent-dark);}

/* Sections */
.section{padding:80px 0;transition: var(--transition-theme);}
.section-alt{background:var(--surface);border-top:1px solid var(--border);border-bottom:1px solid var(--border);}
.section-title{
  text-align:center;font-size:clamp(1.6rem,3vw,2.2rem);
  color:var(--primary);margin-bottom:48px;
}
[data-theme="dark"] .section-title{color:#fff;}

/* Features */
.feature-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:24px;
}
@media (max-width:960px){ .feature-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width:560px){ .feature-grid{grid-template-columns:1fr;} }

    color:var(--primary);max-width:20ch;margin:0 auto 48px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:28px 22px;
  transition:transform .15s ease, box-shadow .15s ease, var(--transition-theme);
}
.feature-card:hover{transform:translateY(-4px);box-shadow:0 12px 24px rgba(36,59,107,0.08);}
.feature-icon{
  width:44px;height:44px;border-radius:10px;
  background:rgba(36,59,107,0.08);
  display:flex;align-items:center;justify-content:center;
  font-size:1.3rem;margin-bottom:16px;
}
.feature-card h3{margin-bottom:8px;font-size:1.02rem;}
.feature-card p{color:var(--text-muted);font-size:0.9rem;}
    border-top:3px solid var(--accent);

/* Steps */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:30px;}
@media (max-width:760px){ .steps{grid-template-columns:1fr;} }
.step{text-align:center;padding:10px;}
.step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:50%;
  background:var(--primary);color:#fff;font-weight:700;
  margin-bottom:14px;
}
.step h3{margin-bottom:8px;}
.step p{color:var(--text-muted);font-size:0.92rem;}

/* CTA box */
.cta-box{
  background:var(--primary);
  color:#fff;
  border-radius:16px;
  padding:56px 40px;
  text-align:center;
}
.cta-box h2{font-size:clamp(1.6rem,3vw,2.2rem);margin-bottom:12px;}
.cta-box p{opacity:0.85;max-width:52ch;margin:0 auto 28px;}
.waitlist-form{
  display:flex;gap:10px;max-width:440px;margin:0 auto;flex-wrap:wrap;justify-content:center;
}
    background:linear-gradient(135deg, var(--primary-dark), var(--primary));
  flex:1;min-width:220px;padding:13px 16px;border-radius:8px;border:none;font-size:0.95rem;
    border-radius:20px;
.waitlist-form input:focus{outline:3px solid var(--accent);}
.form-msg{margin-top:14px;font-size:0.88rem;min-height:1.2em;}
    box-shadow:0 20px 40px rgba(24,39,71,0.18);

/* Auth pages (login / signup) */
.auth-section{ display:flex; justify-content:center; padding:80px 0; }
.auth-box{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:16px;
  padding:44px 36px;
  max-width:420px;
  width:100%;
  margin:0 auto;
  box-shadow:0 10px 30px rgba(0,0,0,0.06);
}
.auth-logo{display:block;width:128px;height:128px;object-fit:contain;margin:0 auto 10px;}
.auth-box h1{ font-size:1.6rem; color:var(--primary); margin-bottom:6px; }
[data-theme="dark"] .auth-box h1{ color:#fff; }
.auth-subtitle{ color:var(--text-muted); font-size:0.92rem; margin-bottom:26px; }
.auth-form{ display:flex; flex-direction:column; gap:6px; }
.auth-form label{ font-size:0.82rem; font-weight:600; margin-top:12px; }
.auth-form input, .auth-form select{
  padding:12px 14px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--bg);
  color:var(--text);
  font-size:0.95rem;
  font-family:inherit;
}
.auth-form input:focus, .auth-form select:focus{ outline:2px solid var(--accent); }
.auth-submit{ margin-top:20px; width:100%; text-align:center; border:none; }
.auth-switch{ margin-top:20px; text-align:center; font-size:0.88rem; color:var(--text-muted); }
.auth-switch a{ color:var(--accent); font-weight:600; }

/* Marketplace */
.marketplace-shell{padding:52px 0 88px;}
.marketplace-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:34px;}
.eyebrow{color:var(--accent);font-size:0.75rem;font-weight:800;letter-spacing:0.1em;text-transform:uppercase;margin-bottom:8px;}
.marketplace-intro h1{color:var(--text);font-size:clamp(2rem,4vw,3rem);letter-spacing:-0.04em;line-height:1.05;margin-bottom:8px;}
.marketplace-subtitle{color:var(--text-muted);font-size:0.95rem;}
.create-listing-btn{white-space:nowrap;box-shadow:0 8px 18px rgba(255,107,69,0.2);}
.create-listing-btn span{font-size:1.25rem;line-height:0;vertical-align:-1px;margin-right:5px;}
.feed-toolbar{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:14px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);margin-bottom:30px;}
.search-field{display:flex;align-items:center;gap:9px;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:0 15px;color:var(--text-muted);min-width:240px;}
.search-field span{font-size:1.35rem;line-height:1;transform:rotate(-20deg);}
.search-field input{border:0;outline:0;background:transparent;color:var(--text);font:inherit;font-size:0.88rem;width:100%;padding:10px 0;}
.bottom-nav-search-popover{position:fixed;right:24px;bottom:94px;z-index:35;padding:8px;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:0 14px 32px rgba(15,22,32,0.2);}
.bottom-nav-search-popover[hidden]{display:none;}
.bottom-nav-search-popover .search-field{min-width:240px;}
.category-tabs{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;}
.category-tabs::-webkit-scrollbar{display:none;}
.category-tab{border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:0.84rem;font-weight:700;white-space:nowrap;padding:9px 13px;border-radius:999px;cursor:pointer;}
.category-tab:hover{color:var(--primary);}
.category-tab.is-active{background:var(--primary);color:#fff;}
.marketplace-layout{display:grid;grid-template-columns:minmax(0,680px) 260px;gap:64px;justify-content:center;align-items:start;}
.listing-feed{display:flex;flex-direction:column;gap:28px;}
.listing-card{background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:0 10px 28px rgba(29,27,22,0.05);transition:transform .2s ease,box-shadow .2s ease,var(--transition-theme);}
.listing-card:hover{transform:translateY(-3px);box-shadow:0 16px 34px rgba(29,27,22,0.1);}
.listing-card-header{display:flex;align-items:center;gap:11px;padding:15px 18px;}
.seller-avatar{display:flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;border-radius:50%;color:#fff;font-size:0.72rem;font-weight:800;letter-spacing:0.04em;}
.avatar-navy{background:var(--primary);}.avatar-orange{background:var(--accent);}.avatar-green{background:var(--success);}
.seller-details{display:flex;flex-direction:column;gap:1px;min-width:0;}
.seller-details strong{font-size:0.88rem;}.seller-details span{color:var(--text-muted);font-size:0.75rem;}
.icon-button{margin-left:auto;border:0;background:transparent;color:var(--text-muted);font-weight:800;letter-spacing:2px;cursor:pointer;padding:6px;}
.listing-image{height:310px;overflow:hidden;background:var(--primary-dark);}
.listing-image img{width:100%;height:100%;object-fit:cover;filter:saturate(0.78) contrast(1.05);transition:transform .5s ease;}
.listing-card:hover .listing-image img{transform:scale(1.04);}
.image-tutoring img{object-position:center 36%;}.image-fridge img{object-position:center 68%;filter:hue-rotate(25deg) saturate(0.72);}.image-design img{object-position:center 52%;filter:hue-rotate(-18deg) saturate(0.82);}
.listing-content{padding:18px 20px 16px;}
.listing-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px;}
.listing-tag{border-radius:999px;padding:4px 9px;font-size:0.68rem;font-weight:800;}.tag-green{background:rgba(46,158,110,0.14);color:var(--success);}.tag-orange{background:rgba(255,107,69,0.14);color:var(--accent-dark);}.tag-blue{background:rgba(36,59,107,0.12);color:var(--primary);}
.listing-price{color:var(--primary);font-size:0.9rem;font-weight:800;}.listing-price span{color:var(--text-muted);font-size:0.75rem;font-weight:600;}
.listing-content h2{font-size:1.15rem;letter-spacing:-0.02em;margin-bottom:5px;}.listing-content p{color:var(--text-muted);font-size:0.88rem;line-height:1.55;}
.listing-actions{display:flex;align-items:center;gap:18px;border-top:1px solid var(--border);margin-top:16px;padding-top:13px;}
.feed-action{display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:0.76rem;cursor:pointer;padding:3px 0;}.feed-action svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8;transition:transform .2s ease,fill .2s ease;}.feed-action b{font-weight:700;}.feed-action:hover,.feed-action.is-active{color:var(--accent);}.feed-action:hover svg{transform:scale(1.08);}.like-button.is-active svg{fill:currentColor;}.save-button.is-active svg{fill:currentColor;}
.save-button{margin-left:auto;}.save-button svg{width:20px;height:20px;}
.marketplace-sidebar{display:flex;flex-direction:column;gap:18px;position:sticky;top:104px;}
.profile-mini,.sidebar-note{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:18px;}.profile-mini-top{display:flex;align-items:center;gap:11px;padding-bottom:17px;}.profile-mini-top strong,.profile-mini-top span{display:block;}.profile-mini-top strong{font-size:0.88rem;}.profile-mini-top span{color:var(--text-muted);font-size:0.76rem;margin-top:2px;}.sidebar-link{display:flex;justify-content:space-between;width:100%;border:0;border-top:1px solid var(--border);padding:14px 0 0;background:transparent;color:var(--accent);font:inherit;font-size:0.8rem;font-weight:700;cursor:pointer;}.sidebar-link span{font-size:1rem;}.sidebar-note{background:rgba(255,107,69,0.08);border-color:rgba(255,107,69,0.22);}.note-mark{display:block;color:var(--accent);font-size:1.3rem;margin-bottom:10px;}.sidebar-note strong{font-size:0.85rem;}.sidebar-note p{color:var(--text-muted);font-size:0.78rem;line-height:1.5;margin-top:5px;}.empty-feed{text-align:center;color:var(--text-muted);padding:42px 0;}
.modal-backdrop{position:fixed;inset:0;z-index:40;background:rgba(15,22,32,0.68);display:flex;align-items:center;justify-content:center;padding:24px;}.modal-backdrop[hidden]{display:none;}.listing-modal{position:relative;background:var(--surface);border:1px solid var(--border);border-radius:16px;width:min(100%,480px);padding:32px;box-shadow:0 24px 60px rgba(0,0,0,0.25);}.modal-close{position:absolute;top:13px;right:16px;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:0;background:transparent;color:var(--text-muted);cursor:pointer;}.modal-close svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-width:2;transition:transform .2s ease;}.modal-close:hover svg{transform:rotate(90deg);}.listing-modal h2{font-size:1.65rem;margin-bottom:5px;}.modal-subtitle{color:var(--text-muted);font-size:0.88rem;margin-bottom:20px;}.listing-form{display:flex;flex-direction:column;gap:12px;}.listing-form label{color:var(--text);font-size:0.78rem;font-weight:700;}.listing-form input,.listing-form select,.listing-form textarea{display:block;width:100%;margin-top:6px;padding:11px 12px;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--text);font:inherit;font-size:0.88rem;resize:vertical;}.listing-form input:focus,.listing-form select:focus,.listing-form textarea:focus{outline:2px solid var(--accent);}.listing-form .auth-submit{margin-top:6px;}

@media (max-width:960px){.marketplace-layout{grid-template-columns:minmax(0,680px);}.marketplace-sidebar{display:none;}}
@media (max-width:760px){.header-actions{gap:8px;}}
@media (max-width:600px){.marketplace-shell{padding:34px 0 60px;}.marketplace-intro{align-items:flex-start;flex-direction:column;margin-bottom:25px;}.create-listing-btn{width:100%;}.feed-toolbar{align-items:stretch;flex-direction:column;gap:12px;}.listing-image{height:240px;}.listing-card-header{padding:13px 15px;}.listing-content{padding:16px 16px 14px;}.listing-modal{padding:28px 20px;}}

.app-panel{max-width:680px;margin:0 auto;background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:0 10px 28px rgba(29,27,22,0.05);}
.profile-page-shell{padding:48px 0 112px;}.profile-page{max-width:760px;margin:0 auto;}
.preferences-shell{min-height:calc(100vh - 72px);display:flex;align-items:center;justify-content:center;padding:54px 24px 80px;}.preferences-box{width:min(100%,560px);background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:42px 38px;box-shadow:0 14px 36px rgba(29,27,22,0.07);}.preferences-box h1{font-size:clamp(1.8rem,4vw,2.35rem);letter-spacing:-0.04em;line-height:1.08;margin-bottom:10px;}.preferences-subtitle{max-width:43ch;color:var(--text-muted);font-size:0.92rem;margin-bottom:26px;}.preference-options{display:flex;flex-direction:column;gap:10px;}.preference-option{display:grid;grid-template-columns:42px 1fr 24px;align-items:center;gap:12px;padding:14px;border:1px solid var(--border);border-radius:12px;cursor:pointer;transition:border-color .2s ease,background .2s ease,transform .2s ease;}.preference-option:hover{border-color:var(--accent);transform:translateY(-1px);}.preference-option:has(input:checked){background:rgba(255,107,69,0.07);border-color:var(--accent);}.preference-option input{position:absolute;opacity:0;pointer-events:none;}.preference-option-icon{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;font-size:1.25rem;font-weight:800;}.preference-icon-green{background:rgba(46,158,110,0.15);color:var(--success);}.preference-icon-orange{background:rgba(255,107,69,0.15);color:var(--accent);}.preference-icon-blue{background:rgba(36,59,107,0.12);color:var(--primary);}.preference-option strong,.preference-option small{display:block;}.preference-option strong{font-size:0.9rem;}.preference-option small{color:var(--text-muted);font-size:0.76rem;margin-top:2px;}.preference-check{display:flex;align-items:center;justify-content:center;width:21px;height:21px;border:1px solid var(--border);border-radius:50%;color:transparent;font-size:0.72rem;}.preference-option:has(input:checked) .preference-check{background:var(--accent);border-color:var(--accent);color:#fff;}.preferences-skip{display:block;margin:17px auto 0;border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:0.82rem;cursor:pointer;}.preferences-skip:hover{color:var(--accent);}
.preference-groups{display:flex;flex-direction:column;gap:18px;}.preference-group{border:0;padding:0;margin:0;min-inline-size:0;}.preference-group legend{display:flex;align-items:center;gap:8px;color:var(--text);font-size:0.86rem;font-weight:800;margin-bottom:9px;padding:0;}.preference-group-icon{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;border-radius:7px;font-size:0.95rem;}.preference-group .preference-option{grid-template-columns:1fr 24px;padding:12px 14px;}.preference-group .preference-option small{max-width:38ch;}
.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:28px 30px;border-bottom:1px solid var(--border);}.panel-heading h2{font-size:1.75rem;letter-spacing:-0.03em;margin-bottom:4px;}.panel-heading p:last-child{color:var(--text-muted);font-size:0.88rem;}.panel-count{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--bg);color:var(--text-muted);font-size:0.8rem;font-weight:800;}
.empty-panel{text-align:center;padding:76px 24px 84px;}.empty-panel-icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border:1px solid var(--border);border-radius:50%;margin:0 auto 18px;color:var(--accent);font-size:2rem;}.empty-panel h3{font-size:1.1rem;margin-bottom:6px;}.empty-panel p{color:var(--text-muted);font-size:0.88rem;margin-bottom:22px;}
.conversation-list{padding:8px 18px 22px;}.conversation-row{display:flex;align-items:center;gap:12px;width:100%;padding:15px 10px;border:0;border-bottom:1px solid var(--border);background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer;}.conversation-row:hover{background:var(--bg);}.conversation-avatar{display:flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;border-radius:50%;color:#fff;font-size:0.7rem;font-weight:800;}.conversation-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1;}.conversation-copy strong{font-size:0.88rem;}.conversation-copy small{overflow:hidden;color:var(--text-muted);font-size:0.78rem;text-overflow:ellipsis;white-space:nowrap;}.conversation-row time{color:var(--text-muted);font-size:0.7rem;}.unread-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);}.messages-tip{display:flex;gap:10px;margin:20px 10px 0;padding:14px;border:1px solid rgba(255,107,69,0.2);border-radius:10px;background:rgba(255,107,69,0.07);}.messages-tip span{color:var(--accent);}.messages-tip p{color:var(--text-muted);font-size:0.76rem;line-height:1.45;}
.messages-layout{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:420px;}.messages-layout .conversation-list{border-right:1px solid var(--border);padding:8px;}.conversation-row.is-active{background:rgba(255,107,69,0.08);}.chat-panel{display:flex;flex-direction:column;min-width:0;}.chat-heading{display:flex;align-items:center;gap:11px;padding:17px 20px;border-bottom:1px solid var(--border);}.chat-heading strong,.chat-heading small{display:block;}.chat-heading small{color:var(--text-muted);font-size:.75rem;margin-top:2px;}.chat-messages{display:flex;flex:1;flex-direction:column;gap:9px;overflow:auto;padding:20px;background:var(--bg);}.chat-bubble{max-width:78%;padding:10px 13px;border-radius:14px;background:var(--surface);border:1px solid var(--border);font-size:.84rem;line-height:1.45;}.chat-bubble.is-mine{align-self:flex-end;background:var(--primary);border-color:var(--primary);color:#fff;border-bottom-right-radius:4px;}.chat-bubble:not(.is-mine){border-bottom-left-radius:4px;}.chat-form{display:flex;gap:8px;padding:13px;border-top:1px solid var(--border);background:var(--surface);}.chat-form input{min-width:0;flex:1;border:1px solid var(--border);border-radius:999px;padding:10px 14px;background:var(--bg);color:var(--text);font:inherit;}.chat-form input:focus{outline:2px solid var(--accent);}.chat-form .btn{padding:10px 16px;}.chat-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;text-align:center;background:var(--bg);}.chat-empty h3{font-size:1rem;margin-bottom:4px;}.chat-empty p{color:var(--text-muted);font-size:.82rem;}.profile-modal{max-width:460px;}
.profile-cover{display:flex;align-items:flex-end;height:132px;padding:18px 24px;background:linear-gradient(120deg,var(--primary-dark),var(--primary),#2e9e6e);color:rgba(255,255,255,0.8);font-size:0.75rem;font-weight:700;}.profile-page-card{text-align:center;padding:0 24px 26px;border-bottom:1px solid var(--border);}.profile-page-avatar{display:flex;align-items:center;justify-content:center;width:82px;height:82px;margin:-41px auto 17px;border:5px solid var(--surface);border-radius:50%;background:var(--accent);color:#fff;font-size:1.35rem;font-weight:800;}.profile-page-card .eyebrow{margin-bottom:5px;}.profile-page-card h2{font-size:1.6rem;}.profile-page-card p:not(.eyebrow){color:var(--text-muted);font-size:0.88rem;margin:4px 0 10px;}.profile-bio{max-width:42ch;margin-right:auto!important;margin-left:auto!important;}.profile-actions{display:flex;justify-content:center;gap:9px;margin-top:17px;}.profile-actions .btn{padding:10px 18px;font-size:0.82rem;}.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);padding:22px;border-bottom:1px solid var(--border);text-align:center;}.profile-stats strong,.profile-stats span{display:block;}.profile-stats strong{font-size:1.2rem;color:var(--primary);}.profile-stats span{color:var(--text-muted);font-size:0.73rem;margin-top:2px;}.profile-tabs{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--border);}.profile-tabs button{padding:14px 8px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--text-muted);font:inherit;font-size:0.78rem;font-weight:700;cursor:pointer;}.profile-tabs button.is-active{border-bottom-color:var(--accent);color:var(--text);}.profile-listing-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;background:var(--border);}.profile-listing-tile{position:relative;aspect-ratio:1;overflow:hidden;background:var(--primary-dark);}.profile-listing-tile img{width:100%;height:100%;object-fit:cover;filter:saturate(0.8);}.profile-listing-tile span{position:absolute;right:7px;bottom:7px;left:7px;color:#fff;font-size:0.67rem;font-weight:700;text-shadow:0 1px 5px rgba(0,0,0,.8);}.profile-settings{padding:10px 22px 14px;}.profile-settings button{display:flex;justify-content:space-between;width:100%;padding:14px 0;border:0;border-bottom:1px solid var(--border);background:transparent;color:var(--text);font:inherit;font-size:0.86rem;text-align:left;cursor:pointer;}.profile-settings button:last-child{border-bottom:0;}.profile-settings span{color:var(--text-muted);}
.bottom-nav{position:fixed;right:0;bottom:0;left:0;z-index:30;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));height:76px;padding:8px 12px max(8px,env(safe-area-inset-bottom));background:color-mix(in srgb,var(--surface) 94%,transparent);border-top:1px solid var(--border);backdrop-filter:blur(18px);}.bottom-nav-item{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;width:100%;min-width:0;border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:0.67rem;font-weight:700;cursor:pointer;transition:color .2s ease,transform .2s ease;}.bottom-nav-item:hover{color:var(--primary);transform:translateY(-2px);}.bottom-nav-item:active{transform:translateY(1px) scale(0.96);}.bottom-nav-icon{display:flex;align-items:center;justify-content:center;height:25px;line-height:1;transition:transform .25s cubic-bezier(.2,.8,.2,1),color .2s ease;}.bottom-nav-icon svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8;}.bottom-nav-item:hover .bottom-nav-icon svg{stroke-width:2.2;}.bottom-nav-item.is-active{color:var(--primary);}.bottom-nav-item.is-active .bottom-nav-icon{color:var(--accent);animation:nav-icon-pop .38s ease both;}.bottom-nav-post .bottom-nav-icon{width:31px;height:31px;border-radius:10px;background:var(--accent);color:#fff;box-shadow:0 6px 14px rgba(255,107,69,0.25);}.bottom-nav-post .bottom-nav-icon svg{width:19px;height:19px;stroke-width:2.2;}.bottom-nav-post{color:var(--accent);}.bottom-nav-post .bottom-nav-icon{animation:post-icon-breathe 2.6s ease-in-out infinite;}.bottom-nav-post:hover .bottom-nav-icon{transform:rotate(90deg) scale(1.06);}
@keyframes nav-icon-pop{0%{transform:translateY(5px) scale(.78);opacity:.45;}65%{transform:translateY(-2px) scale(1.12);opacity:1;}100%{transform:translateY(0) scale(1);}}
@keyframes post-icon-breathe{0%,100%{box-shadow:0 6px 14px rgba(255,107,69,0.2);}50%{box-shadow:0 8px 22px rgba(255,107,69,0.42);}}
@media (prefers-reduced-motion:reduce){.bottom-nav-item,.bottom-nav-icon{transition:none;}.bottom-nav-item.is-active .bottom-nav-icon,.bottom-nav-post .bottom-nav-icon{animation:none;}}

@media (max-width:600px){.marketplace-shell{padding-bottom:110px;}.bottom-nav{padding-right:4px;padding-left:4px;}.bottom-nav-item{font-size:0.62rem;}}
@media (max-width:600px){.messages-layout{display:block;min-height:0;}.messages-layout .conversation-list{border-right:0;}.chat-panel{min-height:390px;border-top:1px solid var(--border);}.chat-empty{min-height:180px;}.chat-form .btn{padding-right:13px;padding-left:13px;}}
@media (max-width:600px){.profile-page-shell{padding:28px 0 110px;}.profile-page{border-radius:0;border-right:0;border-left:0;}}
@media (min-width:961px){
  .bottom-nav{top:0;right:auto;bottom:0;left:0;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;width:88px;height:auto;padding:22px 10px;border-top:0;border-right:1px solid var(--border);}
  .bottom-nav-search-popover{right:auto;left:100px;bottom:24px;}
  .bottom-nav-item{width:68px;min-height:62px;border-radius:12px;}
  .bottom-nav-item:hover{background:var(--bg);}
  .bottom-nav-post{margin:8px 0;}
  .marketplace-shell{padding-left:88px;}
  .site-footer{padding-left:88px;}
}

/* Footer */
.site-footer{padding:36px 0;border-top:1px solid var(--border);transition: var(--transition-theme);}
.footer-inner{
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:14px;
}
.footer-inner p{color:var(--text-muted);font-size:0.82rem;max-width:50ch;}
.footer-links{display:flex;gap:18px;font-size:0.85rem;font-weight:600;}
.footer-links a:hover{color:var(--accent);}

/* Profile settings */
.profile-settings{padding:28px 24px 18px;border-top:1px solid var(--border);}
.profile-settings-heading{display:flex;align-items:center;justify-content:space-between;width:100%;margin:0;padding:0 0 4px;border:0;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer;}
.profile-settings-heading > span:first-child{display:block;}
.profile-settings-heading .eyebrow{display:block;margin-bottom:4px;}
.profile-settings-heading strong{display:block;font-size:1.25rem;}
.settings-chevron{color:var(--accent);font-size:1.4rem;line-height:1;transition:transform .2s ease;}
.profile-settings-heading.is-open .settings-chevron{transform:rotate(180deg);}
.profile-settings-list{border:1px solid var(--border);border-radius:12px;overflow:hidden;}
.profile-setting-row{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:15px 16px;border:0;border-bottom:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;text-align:left;cursor:pointer;}
.profile-setting-row:last-child{border-bottom:0;}
.profile-setting-row:hover{background:var(--bg);}
.profile-setting-row > span:first-child{min-width:0;}
.profile-setting-row strong,.profile-setting-row small{display:block;}
.profile-setting-row strong{font-size:.86rem;}
.profile-setting-row small{margin-top:3px;color:var(--text-muted);font-size:.74rem;line-height:1.4;}
.profile-setting-row > span:last-child:not(.setting-switch){color:var(--text-muted);font-size:1.1rem;}
.profile-setting-row input{position:absolute;opacity:0;pointer-events:none;}
.setting-switch{position:relative;flex:0 0 40px;width:40px;height:23px;border-radius:999px;background:var(--border);transition:background .2s ease;}
.setting-switch::after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform .2s ease;}
.profile-setting-row input:checked + .setting-switch{background:var(--accent);}
.profile-setting-row input:checked + .setting-switch::after{transform:translateX(17px);}
.profile-setting-danger strong,.profile-setting-danger > span:last-child{color:var(--error);}
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important;}

/* ==========================================================
   Messages — rebuilt layout & functionality
   ========================================================== */
.messages-page{max-width:860px;}
.messages-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:28px 30px 18px;border-bottom:1px solid var(--border);}
.messages-header-copy h1{font-size:1.75rem;letter-spacing:-0.03em;line-height:1.1;margin:4px 0 6px;}
.messages-header-copy p:last-child{color:var(--text-muted);font-size:0.88rem;max-width:44ch;line-height:1.5;}
.messages-header-actions{display:flex;align-items:center;gap:12px;flex-shrink:0;}
.messages-header-actions .panel-count{width:36px;height:36px;font-size:0.82rem;background:var(--primary);color:#fff;}
.messages-header-actions .panel-count.is-zero{background:var(--bg);color:var(--text-muted);border:1px solid var(--border);}
.messages-new-btn{padding:10px 16px;font-size:0.84rem;white-space:nowrap;}
.messages-toolbar{display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid var(--border);background:color-mix(in srgb, var(--bg) 72%, var(--surface));}
.messages-search{display:flex;align-items:center;gap:8px;flex:1;min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:0 14px;color:var(--text-muted);transition:border-color .2s ease;}
.messages-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(255,107,69,0.15);}
.messages-search svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.9;opacity:0.7;}
.messages-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--text);font:inherit;font-size:0.88rem;padding:10px 0;}
.messages-filters{display:flex;gap:6px;flex-shrink:0;}
.filter-chip{border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font:inherit;font-size:0.78rem;font-weight:700;padding:7px 12px;border-radius:999px;cursor:pointer;transition:all .15s ease;}
.filter-chip:hover{border-color:var(--accent);color:var(--text);}
.filter-chip.is-active{background:var(--primary);border-color:var(--primary);color:#fff;}

.messages-layout{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:520px;background:var(--surface);}
.conversation-pane{display:flex;flex-direction:column;min-width:0;border-right:1px solid var(--border);background:var(--surface);}
.conversation-list{flex:1;overflow:auto;padding:6px;}
.conversation-empty{padding:44px 20px;text-align:center;}
.conversation-empty .empty-panel-icon{width:56px;height:56px;font-size:1.6rem;}
.conversation-empty h3{font-size:0.98rem;margin-bottom:6px;}
.conversation-empty p{color:var(--text-muted);font-size:0.82rem;line-height:1.5;margin-bottom:16px;}

/* conversation row — enhanced */
.conversation-row{position:relative;display:flex;align-items:center;gap:10px;width:100%;padding:12px 10px;border:1px solid transparent;border-radius:10px;background:transparent;transition:background .15s ease,border-color .15s ease;}
.conversation-row:hover{background:var(--bg);border-color:var(--border);}
.conversation-row.is-active{background:rgba(36,59,107,0.08);border-color:rgba(36,59,107,0.14);}
[data-theme="dark"] .conversation-row.is-active{background:rgba(255,255,255,0.07);border-color:rgba(255,255,255,0.08);}
.conversation-row.is-unread{background:color-mix(in srgb, var(--accent) 7%, var(--surface));}
.conversation-avatar{flex:0 0 42px;}
.conversation-copy{flex:1;min-width:0;gap:2px;}
.conversation-copy-top{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;}
.conversation-copy-top strong{font-size:0.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.conversation-copy-top time{color:var(--text-muted);font-size:0.68rem;font-weight:600;flex-shrink:0;}
.conversation-listing{font-size:0.7rem;color:var(--accent);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.conversation-preview{font-size:0.76rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.conversation-preview.is-unread{color:var(--text);font-weight:600;}
.unread-dot{flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px rgba(255,107,69,0.15);}
.read-dot{flex:0 0 8px;width:8px;height:8px;}

/* chat panel */
.chat-panel{display:flex;flex-direction:column;min-height:0;background:var(--bg);}
.chat-heading{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border);background:var(--surface);}
.chat-back{display:none;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer;}
.chat-back svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;}
.chat-heading-copy{flex:1;min-width:0;}
.chat-heading-copy strong{font-size:0.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-heading-copy small{color:var(--text-muted);font-size:0.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-more{font-size:1.1rem;letter-spacing:2px;padding:6px 8px;}
.chat-messages{flex:1;overflow:auto;padding:18px 16px 20px;display:flex;flex-direction:column;gap:8px;scroll-behavior:smooth;}
.chat-day-separator{display:flex;align-items:center;justify-content:center;gap:10px;margin:6px 0;color:var(--text-muted);font-size:0.68rem;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;}
.chat-day-separator::before,.chat-day-separator::after{content:"";flex:1;height:1px;background:var(--border);}
.chat-system{margin:4px auto;padding:10px 14px;border:1px dashed var(--border);border-radius:10px;background:var(--surface);color:var(--text-muted);font-size:0.78rem;text-align:center;max-width:85%;}
.chat-row{display:flex;align-items:flex-end;gap:8px;}
.chat-row.is-mine-row{justify-content:flex-end;}
.chat-row-avatar{width:28px;height:28px;flex:0 0 28px;font-size:0.58rem;}
.chat-bubble{position:relative;max-width:74%;padding:10px 12px 18px;border-radius:14px;background:var(--surface);border:1px solid var(--border);font-size:0.86rem;line-height:1.45;word-wrap:break-word;}
.chat-bubble p{margin:0;}
.chat-bubble time{position:absolute;right:10px;bottom:4px;font-size:0.62rem;color:var(--text-muted);font-weight:600;letter-spacing:0.02em;}
.chat-bubble.is-mine{background:var(--primary);border-color:var(--primary);color:#fff;border-bottom-right-radius:4px;}
.chat-bubble.is-mine time{color:rgba(255,255,255,0.75);}
.chat-bubble:not(.is-mine){border-bottom-left-radius:4px;}
.chat-typing{display:flex;align-items:center;gap:8px;padding:4px 0;}
.typing-bubble{display:inline-flex;align-items:center;gap:4px;padding:10px 14px;border-radius:14px;background:var(--surface);border:1px solid var(--border);}
.typing-bubble i{display:block;width:6px;height:6px;border-radius:50%;background:var(--text-muted);animation:typing-bounce 1.2s infinite;}
.typing-bubble i:nth-child(2){animation-delay:.15s;}
.typing-bubble i:nth-child(3){animation-delay:.3s;}
@keyframes typing-bounce{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.chat-form{display:flex;align-items:flex-end;gap:8px;padding:12px;border-top:1px solid var(--border);background:var(--surface);}
.chat-input-wrap{position:relative;flex:1;min-width:0;display:flex;align-items:center;}
.chat-input-wrap input{width:100%;padding:11px 64px 11px 14px;border:1px solid var(--border);border-radius:999px;background:var(--bg);color:var(--text);font:inherit;font-size:0.9rem;}
.chat-input-wrap input:focus{outline:0;border-color:var(--accent);box-shadow:0 0 0 3px rgba(255,107,69,0.15);}
.chat-char-count{position:absolute;right:12px;top:50%;transform:translateY(-50%);font-size:0.68rem;color:var(--text-muted);font-weight:700;pointer-events:none;}
.chat-char-count.is-near-limit{color:var(--accent);}
.chat-char-count.is-over{color:var(--error);}
.chat-send{display:inline-flex;align-items:center;gap:6px;padding:11px 16px;border-radius:999px;white-space:nowrap;}
.chat-send svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round;}
.chat-empty{display:flex;align-items:center;justify-content:center;padding:28px;background:var(--bg);text-align:center;}
.chat-empty-inner{max-width:300px;}
.chat-empty h3{font-size:1.05rem;margin-bottom:6px;}
.chat-empty p{color:var(--text-muted);font-size:0.84rem;line-height:1.5;}
.chat-empty-hint{margin-top:18px;padding:12px;border:1px solid rgba(255,107,69,0.18);border-radius:10px;background:rgba(255,107,69,0.07);text-align:left;}
.chat-empty-hint span{color:var(--accent);font-size:0.72rem;font-weight:800;letter-spacing:0.08em;text-transform:uppercase;}
.chat-empty-hint p{margin-top:4px;font-size:0.76rem;}

/* mobile drawer */
@media (max-width:760px){
  .messages-header{flex-direction:column;align-items:stretch;}
  .messages-header-actions{justify-content:space-between;}
  .messages-toolbar{flex-direction:column;align-items:stretch;}
  .messages-filters{align-self:flex-start;}
}
@media (max-width:600px){
  .messages-layout{display:block;min-height:0;}
  .conversation-pane{border-right:0;max-height:none;}
  .chat-panel{min-height:calc(100vh - 220px);border-top:1px solid var(--border);}
  .chat-back{display:inline-flex;}
  .messages-layout.has-active .conversation-pane{display:none;}
  .messages-layout.has-active .chat-empty{display:none!important;}
  .messages-layout:not(.has-active) .chat-panel{display:none!important;}
  .chat-messages{padding:14px 12px 16px;}
  .chat-bubble{max-width:84%;}
}
/* ── Instagram-style profile ── */
.insta-shell .app-panel{max-width:820px;}
.insta-header{display:grid;grid-template-columns:146px minmax(0,1fr);gap:28px;padding:28px 28px 18px;align-items:start;}
.insta-avatar-wrap{position:relative;justify-self:center;}
.insta-avatar{display:flex;align-items:center;justify-content:center;width:120px;height:120px;border-radius:50%;background:var(--accent);color:#fff;font-size:1.8rem;font-weight:800;border:3px solid var(--surface);box-shadow:0 4px 18px rgba(0,0,0,0.12);overflow:hidden;}
.insta-avatar-edit{position:absolute;right:2px;bottom:2px;width:32px;height:32px;border-radius:50%;border:2px solid var(--surface);background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,0.18);}
.insta-avatar-edit svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;}
.insta-meta{display:flex;flex-direction:column;gap:8px;min-width:0;}
.insta-top-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.insta-username{font-size:1.35rem;letter-spacing:-0.02em;font-weight:800;}
.insta-gear,.insta-settings-link{width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:var(--surface);display:flex;align-items:center;justify-content:center;color:var(--text);cursor:pointer;}
.insta-gear svg,.insta-settings-link svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;}
.insta-stats{display:flex;gap:18px;font-size:0.88rem;color:var(--text);padding:6px 0;}
.insta-stats strong{font-weight:800;}
.insta-identity{display:flex;flex-direction:column;gap:2px;}
.insta-identity strong{font-size:0.95rem;}
.insta-campus{font-size:0.78rem;color:var(--accent);font-weight:700;}
.insta-bio{color:var(--text);font-size:0.86rem;line-height:1.45;white-space:pre-wrap;word-break:break-word;max-width:42ch;}
.insta-handle{color:var(--text-muted);font-size:0.8rem;}
.insta-actions{display:flex;gap:8px;margin-top:6px;}
.insta-actions .btn{padding:8px 16px;font-size:0.82rem;}
.insta-new-row{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 28px 0;width:110px;}
.insta-new{width:64px;height:64px;border-radius:50%;border:1px solid var(--border);background:var(--surface);display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text-muted);font-size:2rem;line-height:1;}
.insta-new-plus{font-weight:300;}
.insta-new-label{font-size:0.72rem;font-weight:700;color:var(--text);}
.insta-tabs{margin-top:18px;border-top:1px solid var(--border);display:grid;grid-template-columns:repeat(3,1fr);}
.insta-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;border:0;border-top:2px solid transparent;background:transparent;color:var(--text-muted);cursor:pointer;}
.insta-tabs button.is-active{border-top-color:var(--text);color:var(--text);}
.insta-tabs button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;}
.profile-menu-wide{min-width:220px;}
.profile-edit-modal{max-width:520px;}
.field-hint{color:var(--text-muted);font-size:0.72rem;margin-top:2px;display:block;}
.signup-avatar-row{display:flex;align-items:center;gap:14px;padding:8px 0;}
.signup-avatar-preview{width:64px;height:64px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.1rem;flex:0 0 64px;overflow:hidden;border:2px solid var(--border);}
.signup-avatar-upload{display:flex;flex-direction:column;gap:2px;cursor:pointer;color:var(--primary);font-size:0.84rem;font-weight:700;}
.signup-avatar-upload small{color:var(--text-muted);font-weight:400;font-size:0.72rem;}
.label-hint{color:var(--text-muted);font-weight:400;font-size:0.72rem;}
.char-hint{font-size:0.72rem;color:var(--text-muted);text-align:right;display:block;margin-top:2px;}
.settings-page{max-width:680px;}
.settings-top{display:flex;gap:14px;align-items:center;padding:22px 24px;border-bottom:1px solid var(--border);}
.settings-back{width:32px;height:32px;border-radius:50%;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;text-decoration:none;color:var(--text);font-size:1.2rem;}
.settings-top h1{font-size:1.3rem;}
.settings-tabs{display:flex;gap:0;border-bottom:1px solid var(--border);overflow-x:auto;}
.settings-tabs button{flex:1;padding:12px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--text-muted);font:inherit;font-size:0.82rem;font-weight:700;cursor:pointer;white-space:nowrap;}
.settings-tabs button.is-active{border-bottom-color:var(--primary);color:var(--text);}
.settings-panels{padding:0;}
.settings-list{border-bottom:1px solid var(--border);}
.settings-list:last-child{border-bottom:0;}
.settings-meta{text-align:center;color:var(--text-muted);font-size:0.72rem;padding:16px;}
.settings-pagination{display:flex;gap:6px;justify-content:center;padding:14px;}
.settings-dot{width:6px;height:6px;border-radius:50%;background:var(--border);}
.settings-dot.is-active{background:var(--primary);}
@media (max-width:640px){
  .insta-header{grid-template-columns:86px minmax(0,1fr);gap:16px;padding:18px 16px 12px;}
  .insta-avatar{width:78px;height:78px;font-size:1.3rem;}
  .insta-stats{gap:12px;font-size:0.8rem;}
  .insta-new-row{width:88px;padding-left:16px;}
  .insta-new{width:54px;height:54px;}
}
