/* Главный экран профиля: пул приложений, иконки-квадраты, футуристичный фон */
#homeView{position:relative;padding:26px clamp(16px,3vw,44px) 40px;min-height:calc(100dvh - 92px);overflow:hidden}
#homeView .home-aurora{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;border-radius:24px}
#homeView .blob{position:absolute;border-radius:50%;filter:blur(70px);opacity:.5;will-change:transform}
#homeView .blob-1{width:520px;height:520px;left:-140px;top:-180px;background:radial-gradient(circle at 30% 30%,#3ef0c8,#0a5f57 60%,transparent 72%);animation:drift1 22s ease-in-out infinite alternate}
#homeView .blob-2{width:460px;height:460px;right:-120px;top:-90px;background:radial-gradient(circle at 60% 40%,#7a5cff,#1a1060 62%,transparent 74%);animation:drift2 26s ease-in-out infinite alternate}
#homeView .blob-3{width:560px;height:380px;left:34%;bottom:-200px;background:radial-gradient(circle at 50% 50%,#2fb6ff,#0b3a57 60%,transparent 72%);opacity:.34;animation:drift3 30s ease-in-out infinite alternate}
#homeView .grid-lines{position:absolute;inset:0;background-image:linear-gradient(rgba(120,200,190,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(120,200,190,.07) 1px,transparent 1px);background-size:46px 46px;mask-image:radial-gradient(circle at 50% 20%,#000 30%,transparent 78%)}
@keyframes drift1{to{transform:translate3d(60px,50px,0) scale(1.12)}}
@keyframes drift2{to{transform:translate3d(-70px,60px,0) scale(1.08)}}
@keyframes drift3{to{transform:translate3d(40px,-40px,0) scale(1.14)}}

#homeView > header, #homeView > section{position:relative;z-index:1}

.home-hero{max-width:900px;margin:0 0 26px}
.hero-eyebrow{margin:0;font-size:11px;letter-spacing:.32em;color:var(--accent);opacity:.9}
.home-hero h2{margin:10px 0 8px;font-size:clamp(30px,4.4vw,52px);letter-spacing:-1.6px;font-weight:600;
  background:linear-gradient(92deg,#f3fbf8 10%,#9be8d6 48%,#a9b8ff 92%);-webkit-background-clip:text;background-clip:text;color:transparent}
.hero-sub{margin:0 0 18px;color:#a9bcb9;font-size:15px;max-width:560px}
.hero-chips{display:flex;flex-wrap:wrap;gap:10px}
.chip{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;font-size:12.5px;
  background:rgba(16,24,28,.72);border:1px solid rgba(94,234,212,.22);color:#cfe9e2;backdrop-filter:blur(8px)}
.chip-live::before{content:"";width:7px;height:7px;border-radius:50%;background:#3ef0c8;box-shadow:0 0 10px #3ef0c8;animation:pulse 2.4s ease-in-out infinite}
.chip-ok{color:#0d2a22;background:linear-gradient(120deg,#8ff0d5,#4fe0c0);border-color:transparent;font-weight:600}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}

.pool{margin:0 0 26px}
.pool-head{display:flex;align-items:baseline;gap:14px;margin-bottom:16px}
.pool-head h3{margin:0;font-size:12px;letter-spacing:.3em;color:#8fa8a4;font-weight:600}
.pool-hint{font-size:12px;color:#6f8580}

.app-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:20px 18px;max-width:940px}
.app-tile{display:grid;justify-items:center;gap:9px;padding:0;background:none;border:0;cursor:pointer;font:inherit;color:inherit;
  transition:transform .18s cubic-bezier(.2,.8,.3,1)}
.app-tile[hidden]{display:none}
.tile-icon{position:relative;display:grid;place-items:center;width:100%;max-width:96px;aspect-ratio:1;border-radius:28%;
  background:linear-gradient(150deg,var(--g1,#2fd6b6),var(--g2,#0e7f80));
  box-shadow:0 10px 26px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.35),inset 0 -14px 24px rgba(0,0,0,.22);
  transition:box-shadow .2s ease,transform .18s cubic-bezier(.2,.8,.3,1)}
.tile-icon::after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(180deg,rgba(255,255,255,.28),transparent 46%)}
.tile-icon svg{width:44%;height:44%;fill:none;stroke:#04150f;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;
  position:relative;z-index:1;filter:drop-shadow(0 1px 0 rgba(255,255,255,.25))}
.tile-name{font-size:12.5px;font-weight:600;color:#e6f3ef;text-align:center;line-height:1.25}
.tile-hint{font-size:10.5px;color:#7f9b96;text-align:center;line-height:1.2}
.app-tile:hover .tile-icon{transform:translateY(-3px) scale(1.04);box-shadow:0 16px 34px rgba(0,0,0,.5),0 0 0 1px rgba(94,234,212,.35),inset 0 1px 0 rgba(255,255,255,.4)}
.app-tile:active .tile-icon{transform:scale(.965)}
.app-tile:focus-visible .tile-icon{outline:2px solid #a7dcc4;outline-offset:4px}
.tile-chat{--g1:#5eead4;--g2:#0e9f8c}
.tile-family{--g1:#a78bfa;--g2:#5b3fd6}
.tile-calendar{--g1:#7dd3fc;--g2:#1a63a8}
.tile-tv{--g1:#fbbf24;--g2:#b45309}
.tile-social{--g1:#93c5fd;--g2:#1d4ed8}
.tile-notes{--g1:#fda4af;--g2:#9f1239}
.tile-files{--g1:#c4b5fd;--g2:#4338ca}
.tile-web{--g1:#5eead4;--g2:#0f766e}

.home-panels{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:18px;max-width:940px}
.panel-card{padding:18px 20px;border-radius:20px;background:rgba(14,21,25,.72);border:1px solid rgba(94,234,212,.16);
  backdrop-filter:blur(10px);box-shadow:0 18px 40px rgba(0,0,0,.35)}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.panel-head h3{margin:0;font-size:12px;letter-spacing:.28em;color:#8fa8a4;font-weight:600}
.agenda{display:grid;gap:8px}
.agenda-item{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:9px 12px;border-radius:12px;
  background:rgba(255,255,255,.04);border-left:3px solid var(--accent)}
.agenda-item b{font-size:14px;font-weight:600;color:#e6f3ef}
.agenda-item span{font-size:12px;color:#8ea0a2;white-space:nowrap}
.agenda-empty{margin:0;color:#7f9b96;font-size:13px}
.pill-row{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:12px}
.pill{padding:9px 14px;border-radius:999px;border:1px solid rgba(94,234,212,.3);background:rgba(255,255,255,.04);
  color:#d6ece6;font:inherit;font-size:12.5px;cursor:pointer;transition:background .18s,border-color .18s,transform .18s}
.pill:hover{background:rgba(94,234,212,.16);border-color:rgba(94,234,212,.55);transform:translateY(-1px)}
.pill[hidden]{display:none}
.panel-note{margin:0 0 10px;font-size:12px;color:#7f9b96;line-height:1.5}

@media (max-width:820px){
  .app-grid{grid-template-columns:repeat(auto-fill,minmax(86px,1fr));gap:16px 14px}
  .tile-hint{display:none}
  .home-panels{grid-template-columns:1fr}
  .hero-sub{font-size:14px}
}
@media (prefers-reduced-motion:reduce){
  #homeView .blob{animation:none}
  .app-tile,.tile-icon,.pill{transition:none}
}

/* После входа: приложение занимает всю ширину (вход остаётся двухколоночным) */
body[data-view="homeView"] main,
body[data-view="notesView"] main,
body[data-view="filesView"] main,
body[data-view="familyChatView"] main,
body[data-view="chatView"] main,
body[data-view="calendarView"] main,
body[data-view="adminView"] main,
body[data-view="passwordView"] main,
body[data-view="setupView"] main{grid-template-columns:minmax(0,1fr);max-width:none;padding:0;margin:0;gap:0}
body[data-view="homeView"] .intro,
body[data-view="notesView"] .intro,
body[data-view="filesView"] .intro,
body[data-view="familyChatView"] .intro,
body[data-view="chatView"] .intro,
body[data-view="calendarView"] .intro,
body[data-view="adminView"] .intro,
body[data-view="passwordView"] .intro,
body[data-view="setupView"] .intro{display:none}
body[data-view="homeView"] .panel{border:0;background:transparent;border-radius:0;padding:0;box-shadow:none}

/* Приглашения и участники — аккуратные карточки */
.notes-list{gap:10px}
.invite-card{display:grid;gap:10px;background:rgba(20,27,31,.85);border:1px solid #2d3a3d;border-radius:12px;padding:14px 16px}
.invite-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.invite-when{font-size:12.5px;color:#8ea0a2}
.invite-badge{font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:4px 10px;border-radius:999px;border:1px solid transparent}
.invite-badge.active{color:#0d2a22;background:linear-gradient(120deg,#8ff0d5,#4fe0c0)}
.invite-badge.used{color:#cfd8d6;background:rgba(255,255,255,.08);border-color:#3a4749}
.invite-badge.expired{color:#ffcfb2;background:rgba(217,119,6,.16);border-color:#7c4a12}
.invite-card button{justify-self:start}
/* Семейная главная: адаптивное пространство приложений */
#homeView{padding:clamp(28px,4vw,64px);}
#homeView .home-hero,#homeView .pool,#homeView .home-panels{position:relative;z-index:1;max-width:1480px;margin-left:auto;margin-right:auto}
#homeView .home-hero{margin-bottom:48px}
#homeView .home-hero h2{font-size:clamp(34px,3.8vw,56px)}
#homeView .pool{margin-bottom:36px}
#homeView .pool-head{align-items:center;margin-bottom:20px}
#homeView .pool-head h3,#homeView .panel-head h3{letter-spacing:.15em;color:#a8c9c2}
#homeView .app-grid{max-width:none;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px}
#homeView .app-tile{min-width:0;min-height:112px;display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:auto auto;align-content:center;align-items:center;justify-items:start;gap:4px 16px;padding:20px;border:1px solid rgba(135,221,204,.16);border-radius:16px;background:rgba(17,29,32,.82);text-align:left;text-decoration:none;box-shadow:none;transition:background .18s,border-color .18s,transform .18s}
#homeView .app-tile[hidden]{display:none}
#homeView .tile-icon{grid-row:1 / 3;width:48px;height:48px;max-width:none;border-radius:12px;background:rgba(94,234,212,.10);box-shadow:none;transform:none}
#homeView .tile-icon::after{display:none}
#homeView .tile-icon svg{width:24px;height:24px;stroke:#84dfcc;filter:none}
#homeView .tile-name{font-size:15px;color:#e8f4f1;text-align:left;align-self:end}
#homeView .tile-hint{font-size:12px;color:#a2b9b5;text-align:left;align-self:start}
#homeView .app-tile:hover{transform:translateY(-2px);background:rgba(29,51,50,.96);border-color:rgba(122,225,205,.48)}
#homeView .app-tile:hover .tile-icon{transform:none;box-shadow:none}
#homeView .app-tile:focus-visible{outline:2px solid #8ce9d5;outline-offset:3px}
#homeView .home-panels{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:14px}
#homeView .panel-card{min-width:0;padding:24px;border-radius:16px;background:rgba(15,27,29,.84);box-shadow:none}
@media(max-width:820px){#homeView{padding:26px 18px 38px}#homeView .home-hero{margin-bottom:32px}#homeView .app-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#homeView .app-tile{min-height:100px;padding:14px;grid-template-columns:40px minmax(0,1fr);gap:4px 10px}#homeView .tile-icon{width:40px;height:40px}#homeView .tile-hint{display:block;font-size:11px}#homeView .home-panels{grid-template-columns:1fr}}
@media(max-width:360px){#homeView .app-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){#homeView .app-tile{transition:none}}
