/* Хочу! — современный mobile-first интерфейс. Логика Firebase остаётся в app.js. */
:root {
  --ink:#27263c;
  --muted:#88879b;
  --purple:#7352c8;
  --purple-dark:#603db9;
  --lavender:#f1edfb;
  --pale:#f7f8fc;
  --line:#e9e8f1;
  --white:#fff;
  --shadow:0 5px 24px rgba(32,28,68,.045);
}
html {background:var(--pale);scroll-behavior:smooth}
body {background:var(--pale);color:var(--ink);font-family:Manrope,system-ui,-apple-system,sans-serif}
.icon-sprite{position:absolute!important;width:0!important;height:0!important;overflow:hidden!important}
svg:not(.icon-sprite){width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
button,select,input,textarea{font-family:inherit}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #b5a2ed;outline-offset:3px}
.primary-btn,.secondary-btn {border-radius:12px;font-size:.83rem;font-weight:750;min-height:40px;padding:9px 15px;box-shadow:none}
.primary-btn {background:var(--purple)}
.secondary-btn {border:1px solid var(--line);color:#5f547d;background:white}
.primary-btn svg,.secondary-btn svg{width:17px;height:17px;vertical-align:middle}
.eyebrow {color:#8473af;font-size:.66rem;letter-spacing:.12em;font-weight:800}

/* Верхняя панель — как у мобильного приложения */
.topbar {width:100%;max-width:none;background:#fff;border-bottom:1px solid #ecebf4;padding:12px max(24px,calc((100vw - 1160px)/2));height:72px;position:sticky;top:0;z-index:30;box-shadow:0 2px 16px rgba(43,39,83,.025)}
.logo{display:flex;align-items:center;gap:9px;line-height:1;font-size:1.6rem;letter-spacing:-.075em}
.logo-mark {width:38px;height:38px;background:#7857ce;color:white;display:grid;place-items:center;border-radius:12px}
.logo-mark svg{width:22px;height:22px;stroke-width:1.9}
.logo-word{color:#252338}
.logo-dot{color:var(--purple)}
.topbar-right{gap:11px}
.user-pill{border:0;background:none;padding:5px 0;max-width:170px;font-weight:650;color:#59546a}
.profile-avatar{display:grid;place-items:center;width:36px;height:36px;background:#ebe3ff;color:#7050c4;border-radius:50%;font-size:14px;font-weight:800}
.text-btn{font-size:.81rem;font-weight:700;color:#8a87a0}
.text-btn:hover{color:var(--purple)}
.container{max-width:1160px;padding:0 24px 70px}
.dashboard-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:28px 0 20px}
.dashboard-intro h1{font-weight:800;font-size:1.75rem;letter-spacing:-.055em;line-height:1.28;margin:5px 0 7px}
.dashboard-intro p{font-size:.88rem;color:var(--muted);margin:0;line-height:1.5}
.intro-heart{color:#af83e3;font-size:1.35rem}
.intro-icon{width:62px;height:62px;display:grid;place-items:center;flex:none;border-radius:20px;background:linear-gradient(140deg,#ede6fd,#fcf3ff);color:#9874d5;transform:rotate(7deg)}
.intro-icon svg{width:31px;height:31px;stroke-width:1.6}
.hero{display:none}

/* Круг / верхние быстрые действия */
.spacebar{display:flex;align-items:center;gap:14px;padding:16px 18px;margin:0 0 27px;background:white;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}
.space-control{flex:1;min-width:0;display:flex;align-items:center;gap:12px}
.space-control label{display:inline-flex;align-items:center;gap:7px;font-size:.81rem;font-weight:750;color:#69647c;white-space:nowrap}
.space-control label svg{width:17px;height:17px;color:#8a6dcc}
.space-control select{width:auto;min-width:160px;max-width:260px;flex:1;border-radius:10px;background:#f8f7fc;border:1px solid #eeedf4;font-size:.82rem;font-weight:700;padding:10px 28px 10px 10px;color:#403853}
.space-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.space-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px}

/* Семья / вкладки */
.section-head{display:flex;justify-content:space-between;align-items:end;margin:0 0 12px;gap:12px}
.section-head h2{font-size:1.34rem;margin:3px 0 0;letter-spacing:-.04em}
.member-counter {background:#f0edfa;border:0;border-radius:99px;color:#7562a4;padding:6px 11px;font-size:.75rem;font-weight:700;white-space:nowrap}
.member-tabs{display:flex;gap:8px;margin:0 0 0;overflow-x:auto;scrollbar-width:none;padding:3px 2px 7px}
.member-tabs::-webkit-scrollbar{display:none}
.member-tab{border-color:#e6e3ef;background:#fff;border-radius:13px;padding:6px 12px 6px 6px;gap:8px;font-size:.83rem;font-weight:750;box-shadow:none}
.member-tab.active{background:#eee8fc;border-color:#c3b2ed;box-shadow:none;color:#603db9}
.avatar{width:31px;height:31px;background:#e3dafa;font-size:.85rem}
.member-tab.active .avatar{background:#7652ca;color:white}
.wishlist-heading{margin:28px 0 13px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.wishlist-heading h2{font-size:1.35rem;font-weight:800;margin:0;letter-spacing:-.045em}
.wishlist-heading p{margin:3px 0 0;font-size:.8rem;line-height:1.5;color:#8b899e}
.wish-count{display:inline-block;margin-top:7px;font-size:.69rem;font-weight:700;color:#8c83a0}
.wishlist-heading .primary-btn{display:inline-flex;align-items:center;gap:6px;justify-content:center}

/* Компактный ровный ряд карточек */
.wishes-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.wish-card{display:grid;grid-template-columns:104px minmax(0,1fr);min-height:157px;border:1px solid #e9e8f2;border-radius:17px;overflow:hidden;background:white;box-shadow:0 5px 16px rgba(60,49,92,.035)}
.wish-media{width:104px;height:auto;min-height:100%;background:linear-gradient(150deg,#efebfc,#f7eafa);display:flex;align-items:center;justify-content:center}
.fund-card .wish-media{background:linear-gradient(140deg,#e7f4f2,#eae7fc)}
.wish-media img{width:100%;height:100%;object-fit:cover}
.wish-placeholder{display:grid;place-items:center;width:57px;height:57px;border-radius:18px;background:#ffffffaf;color:#987bd2;transform:none}
.wish-placeholder svg{width:30px;height:30px;stroke-width:1.5}
.fund-card .wish-placeholder{color:#5c9b90}
.wish-body{min-width:0;display:flex;flex-direction:column;padding:12px 13px 11px;gap:0}
.wish-label{display:inline-flex;align-self:flex-start;max-width:100%;border-radius:99px;font-size:.62rem;letter-spacing:.015em;font-weight:800;padding:4px 8px;margin:0 0 6px;background:#f2eefc;color:#7555b5}
.fund-card .wish-label{background:#e9f6f3;color:#4d8f83}
.wish-label.reserved{background:#fff3e3;color:#a87442}
.wish-title{font-size:.94rem;font-weight:750;line-height:1.37;letter-spacing:-.025em;margin:0 0 5px;overflow-wrap:anywhere;hyphens:auto}
.wish-title.clamped:not(.expanded){display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.wish-expand{display:inline-flex;margin:0 0 5px;padding:0;align-self:flex-start;font-size:.7rem;color:#7961b6;letter-spacing:0}
.wish-notes{font-size:.71rem;line-height:1.35;margin:1px 0 6px;color:#8a8799;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;flex:none}
.wish-price{font-size:1rem;font-weight:850;letter-spacing:-.03em;color:#363149;margin:1px 0 9px}
.wish-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:auto}
.wish-actions .primary-btn,.wish-actions .secondary-btn {min-height:33px;padding:7px 11px;font-size:.71rem;border-radius:9px;flex:0 1 auto}
.wish-actions .small-link{display:inline-flex;align-items:center;gap:3px;color:#8065b3;font-size:.7rem;font-weight:750;text-decoration:none;white-space:nowrap}
.small-link svg{width:13px;height:13px;stroke-width:2}
.fund-goal{font-size:.77rem;margin:2px 0 6px;color:#4f4868;letter-spacing:-.01em}
.fund-progress{background:#e8e6f1;height:6px;border-radius:99px;margin:3px 0 5px}
.fund-progress span{background:linear-gradient(90deg,#9f85df,#7454ce)}
.fund-progress-note{font-size:.7rem;line-height:1.35;color:#878399;margin-bottom:8px}
.fund-preference{font-size:.71rem;background:#f2f0fa;border:0;border-radius:8px;padding:7px;color:#755e9d;margin:0 0 8px}
.empty-space,.empty-wishes{margin:14px 0 0;padding:30px 22px;background:#fff;border:1px dashed #d5cce9;border-radius:18px;box-shadow:none}
.empty-space p,.empty-wishes p{line-height:1.55;font-size:.86rem}
.empty-icon{width:56px;height:56px;border-radius:17px;background:#f2edfd;color:#8863ce;display:grid;place-items:center;margin:0 auto 12px}
.empty-icon svg{width:27px;height:27px}
.footer{border:0;font-size:.7rem;color:#aaa7b5;background:transparent;padding:27px 0}

/* Диалоги и форма авторизации */
.auth-layout{max-width:990px;min-height:calc(100vh - 45px);margin:auto;grid-template-columns:.94fr 1.06fr;padding:30px;gap:0;align-items:stretch}
.auth-decoration{border-radius:26px 0 0 26px;background:linear-gradient(145deg,#7b59cf,#9c7ade);padding:36px 40px;justify-content:center}
.auth-decoration h1{font-size:5rem}
.auth-decoration p{font-size:1.07rem}
.sparkle{font-size:3rem}
.decoration-stickers{font-size:2.3rem}
.auth-panel{border:1px solid #eeeaf4;border-left:0;border-radius:0 26px 26px 0;background:#fff;max-width:none;padding:40px 42px}
.auth-panel h2{font-size:1.85rem}
.auth-panel .subtle{font-size:.86rem;line-height:1.6}
.auth-switch{background:#f2f0f8;margin:17px 0;border-radius:12px;padding:4px}
.auth-switch button{font-size:.84rem;padding:11px;border-radius:9px}
.stack-form{gap:13px}
.stack-form label{font-size:.82rem;gap:6px}
.stack-form input,.modal-fields input,.modal-fields textarea,.modal-fields select{border-radius:11px;background:#fff;padding:12px 14px;border:1px solid #e3e0ed;font-size:.87rem}
.stack-form .tiny-help,.tiny-help{color:#9691a3;font-size:.72rem;line-height:1.45}
.fineprint{font-size:.72rem;line-height:1.55}
.modal-card{border-radius:22px;padding:24px}
.modal-head h2{font-size:1.28rem;letter-spacing:-.035em}
.modal-fields{gap:14px}
.modal-fields label{font-size:.81rem}
.modal-fields p{font-size:.82rem}
.modal-actions{margin-top:18px;gap:9px}
.wish-type-pill{font-size:.76rem;background:#f7f6fb;border-color:#e7e3f0}
.toast{z-index:99;background:#302b4b;border-radius:13px;font-size:.82rem;bottom:90px}
.mobile-nav{display:none}

@media(max-width:850px){
  .wishes-grid{grid-template-columns:1fr}
  .spacebar{flex-wrap:wrap;gap:12px}
  .space-control{flex-basis:100%}
  .space-actions{width:100%;justify-content:space-between}
  .space-actions button{flex:1}
}
@media(max-width:640px){
  .topbar{height:62px;padding:10px 16px;gap:10px}
  .logo{font-size:1.35rem;gap:8px}
  .logo-mark{width:34px;height:34px;border-radius:10px}
  .logo-mark svg{width:20px;height:20px}
  .topbar-right{gap:9px}
  .user-pill{font-size:.75rem;display:block;max-width:min(27vw,110px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .profile-avatar{width:32px;height:32px;font-size:.72rem}
  .text-btn{font-size:.72rem}
  .container{padding:0 16px 98px}
  .dashboard-intro{padding:21px 0 18px;align-items:center}
  .dashboard-intro h1{font-size:1.27rem;line-height:1.32;margin:3px 0 0;max-width:270px}
  .dashboard-intro p{display:none}
  .intro-heart{font-size:1.04rem}
  .intro-icon{width:48px;height:48px;border-radius:14px;transform:rotate(8deg)}
  .intro-icon svg{width:24px;height:24px}
  .eyebrow{font-size:.58rem;letter-spacing:.13em}
  .spacebar{display:block;margin:0 0 24px;border-radius:16px;padding:12px 13px;box-shadow:none}
  .space-control{display:flex;align-items:center;gap:10px;width:100%;flex-wrap:nowrap}
  .space-control label{font-size:.77rem;min-width:87px;gap:6px}
  .space-control select{width:100%;min-width:0;max-width:none;flex:1;font-size:.77rem;padding:9px 26px 9px 10px;min-height:38px}
  .space-actions{display:grid;grid-template-columns:1fr 1fr 1.12fr;gap:6px;margin-top:10px}
  .space-actions button{width:100%;min-width:0;min-height:35px;border-radius:10px;padding:7px 5px;font-size:.69rem;white-space:nowrap;gap:4px}
  .space-actions #invite-btn{grid-column:auto}
  .space-actions button svg{width:14px;height:14px}
  .section-head{align-items:center;margin:0 0 9px}
  .section-head h2{font-size:1.04rem;margin-top:2px}
  .member-counter{font-size:.65rem;padding:5px 9px}
  .member-tabs{padding:2px 0 9px;gap:7px}
  .member-tab{font-size:.76rem;padding:5px 11px 5px 5px;border-radius:12px}
  .avatar{width:28px;height:28px;font-size:.78rem}
  .wishlist-heading{margin:23px 0 12px;align-items:center}
  .wishlist-heading h2{font-size:1.15rem;margin:0}
  .wishlist-heading p{display:none}
  .wish-count{margin-top:3px;font-size:.65rem}
  .wishlist-heading .primary-btn{font-size:.74rem;min-height:37px;padding:8px 11px;border-radius:10px;gap:3px}
  .wishlist-heading .primary-btn svg{width:15px;height:15px}
  .wishes-grid{grid-template-columns:1fr;gap:9px}
  .wish-card{grid-template-columns:86px minmax(0,1fr);min-height:134px;border-radius:15px;box-shadow:0 4px 12px rgba(38,29,64,.025)}
  .wish-media{width:86px;height:auto;min-height:100%}
  .wish-placeholder{width:49px;height:49px;border-radius:15px}
  .wish-placeholder svg{width:27px;height:27px}
  .wish-body{padding:11px 12px 10px;min-width:0}
  .wish-label{padding:3px 7px;font-size:.57rem;margin:0 0 5px}
  .wish-title{font-size:.82rem;line-height:1.35;letter-spacing:-.018em;margin:0 0 5px}
  .wish-notes{display:none}
  .wish-expand{font-size:.66rem;line-height:1.3;margin:-1px 0 4px}
  .wish-price{font-size:.88rem;margin:0 0 7px}
  .wish-actions{gap:6px}
  .wish-actions .primary-btn,.wish-actions .secondary-btn{font-size:.69rem;padding:6px 9px;min-height:30px;border-radius:8px}
  .wish-actions .small-link{font-size:.67rem}
  .fund-goal{font-size:.68rem;margin:1px 0 5px}
  .fund-progress{height:5px;margin:2px 0 4px}
  .fund-progress-note{font-size:.64rem;margin:0 0 7px}
  .fund-preference{font-size:.65rem;padding:5px 7px;margin-bottom:7px}
  .empty-space,.empty-wishes{padding:28px 18px;margin:10px 0}
  .empty-space h2,.empty-wishes h3{font-size:1.23rem}
  .empty-space p,.empty-wishes p{font-size:.76rem}
  .footer{display:none}
  .mobile-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;z-index:35;min-height:67px;padding:7px 10px calc(7px + env(safe-area-inset-bottom));border-top:1px solid #e8e7f0;background:#fff;box-shadow:0 -5px 22px rgba(31,27,61,.055)}
  .nav-item{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;border:0;border-radius:10px;background:transparent;color:#9893a9;font-size:.6rem;font-weight:750;padding:2px}
  .nav-item svg{width:19px;height:19px;stroke-width:1.8}
  .nav-item.active{color:#7352c8}
  .nav-item-add .add-circle{width:31px;height:31px;border-radius:11px;background:#7755cc;color:white;display:grid;place-items:center;margin-top:-6px;box-shadow:0 5px 12px rgba(120,84,200,.2)}
  .nav-item-add .add-circle svg{width:20px;height:20px;stroke-width:2.3}
  .nav-item-add{color:#7352c8}
  #space-panel,#members-panel,#wishlist-panel{scroll-margin-top:76px}
  .auth-layout{grid-template-columns:1fr;display:block;padding:0;min-height:100vh;background:#fff}
  .auth-decoration{padding:30px 24px 22px;border-radius:0 0 24px 24px;min-height:154px}
  .auth-decoration h1{font-size:3.65rem;margin-top:0}
  .auth-decoration p{font-size:.9rem;margin:0}
  .sparkle,.decoration-stickers{display:none}
  .auth-panel{padding:26px 22px 40px;border:0;border-radius:0}
  .auth-panel h2{font-size:1.65rem;margin:9px 0 5px}
  .auth-panel .subtle{margin:5px 0}
  .auth-switch{margin:18px 0}
  .stack-form{gap:14px}
  .modal{width:100%;max-width:100%;margin:auto 0 0;max-height:93dvh;position:fixed;inset:auto 0 0 0}
  .modal-card{border-radius:22px 22px 0 0;max-height:90dvh;padding:22px 18px calc(24px + env(safe-area-inset-bottom));box-shadow:0 0 32px rgba(31,26,56,.17)}
  .toast{bottom:80px;max-width:calc(100vw - 28px)}
}
@media(max-width:360px){
 .container{padding-left:12px;padding-right:12px}
 .topbar{padding-left:12px;padding-right:12px}
 .user-pill{display:none}
 .space-actions button{font-size:.64rem}
 .wish-card{grid-template-columns:76px minmax(0,1fr)}
 .wish-media{width:76px}
 .wish-body{padding:10px}
 .wish-title{font-size:.76rem}
 .wish-actions .primary-btn,.wish-actions .secondary-btn{font-size:.64rem}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.primary-btn,.secondary-btn{transition:none}}

/* Совместное бронирование: компактный выбор и участники */
.booking-intro{color:#383249;font-weight:750;line-height:1.45;margin:0 0 12px}
.booking-mode-list{display:grid;gap:9px;margin:10px 0 14px}
.booking-mode{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:12px!important;padding:13px!important;background:#f8f7fc;border:1px solid #e6e1f0;border-radius:13px;cursor:pointer}
.booking-mode input{width:18px!important;height:18px!important;min-width:18px;accent-color:#7755cc;margin:2px 0 0;padding:0!important}
.booking-mode span{display:grid;gap:3px}
.booking-mode strong{font-size:.88rem;font-weight:800;color:#37314b}
.booking-mode small{font-size:.75rem;line-height:1.42;color:#868094;font-weight:400}
.booking-people{list-style:none;margin:9px 0 12px;padding:0;display:grid;gap:7px}
.booking-people li{display:flex;align-items:center;gap:10px;background:#f8f7fc;border-radius:11px;padding:9px 11px;font-size:.82rem;color:#353049}
.booking-people li small{color:#847d96;font-size:.7rem}
.booking-avatar{display:grid;place-items:center;flex:none;width:31px;height:31px;border-radius:50%;background:#e7dcfb;color:#7054ad;font-weight:850}
@media(max-width:640px){
 .booking-mode{padding:11px!important}
 .booking-mode strong{font-size:.82rem}
 .modal-actions:has(#cancel-booking),.modal-actions:has(#leave-booking){flex-wrap:wrap;justify-content:stretch}
 .modal-actions:has(#cancel-booking) button,.modal-actions:has(#leave-booking) button{flex:1 0 auto}
}
