/* Companion layer: Mo, speech bubbles, avatars, safety, app shell, Today, Talk, onboarding, profile. */

/* ---------- Mo ---------- */
.mo { display: block; overflow: visible; }
.mo-anim .mo-body { animation: moBob 3.2s ease-in-out infinite; transform-origin: 60px 110px; }
.mo-anim .mo-eye { animation: moBlink 5s infinite; transform-box: fill-box; transform-origin: center; }
.mo-anim .mo-wave { animation: moWave 1.1s ease-in-out infinite; transform-origin: 97px 66px; }
@keyframes moBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes moBlink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes moWave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }
@keyframes moPop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }

.mo-say { display: flex; gap: 12px; align-items: flex-end; margin: 10px 0; animation: fadeIn .35s ease both; }
.mo-say .mo-av { flex: none; }
.mo-say .bubble {
  position: relative; background: #fff; border: 1px solid var(--char-10); box-shadow: var(--shadow);
  border-radius: 18px 18px 18px 6px; padding: 12px 44px 12px 16px; max-width: 620px; font-size: 1.08rem; font-weight: 500; color: var(--char);
}
.mo-say .bubble .who { display: block; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; color: var(--red); margin-bottom: 2px; }
.mo-say .say-btn { position: absolute; right: 8px; top: 8px; border: 0; background: var(--char-5); color: var(--red); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.mo-say .say-btn.speaking { background: var(--red); color: #fff; }
.mo-say.big .bubble { font-size: 1.25rem; }

/* ---------- Avatar ---------- */
.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-family: var(--font-display); font-weight: 800; flex: none; line-height: 1; }
.avatar-sticker { position: absolute; right: -14%; bottom: -14%; background: #fff; border-radius: 50%; padding: 2px; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.avatar-sticker .illo { width: 100%; height: auto; }
.avatar-btn { display: inline-flex; text-decoration: none; border-radius: 50%; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--red-20); }

/* ---------- Safety ---------- */
.safety-card { border: 2px solid var(--red); background: #fff; border-radius: 14px; padding: 16px 18px; margin: 12px 0; }
.safety-head { display: flex; gap: 8px; align-items: center; color: var(--red); font-size: 1.1rem; margin-bottom: 6px; }
.helpline { display: flex; flex-direction: column; text-decoration: none; background: var(--red-10); border-radius: 10px; padding: 10px 14px; margin-top: 8px; color: var(--char); }
.helpline b { color: var(--red); }
.helpline span { font-size: .92rem; }

/* ---------- Shell: nav icons, mobile tab bar ---------- */
.nav a .ico { color: inherit; }
@media (max-width: 1060px) {
  .menu-btn { display: none !important; }
  .nav { display: flex !important; position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 60; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -6px 20px rgba(51, 61, 71, .08); margin: 0; }
  .nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: 4px 2px; border: 0 !important; flex: 1; text-align: center; justify-content: center; }
  .nav a .ico { width: 24px; height: 24px; }
  .nav a.active { color: var(--red); }
  .nav a.active .ico { background: var(--red-10); border-radius: 10px; padding: 2px; width: 30px; height: 28px; }
  body { padding-bottom: 72px; }
}

/* ---------- Generic pieces used by modules ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip { border: 1px solid var(--char-20); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--char); }
.pick-chip:hover { border-color: var(--red); color: var(--red); }
.pick-chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.pick-chip .ico { color: inherit; }
.field { display: block; margin: 14px 0; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; color: var(--char); }
.input, .textarea {
  width: 100%; font: inherit; color: var(--char); border: 1px solid var(--char-20); border-radius: 10px; padding: 12px 14px; background: #fff;
}
.input:focus, .textarea:focus { outline: 3px solid var(--red-20); border-color: var(--red); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.empty-state { text-align: center; padding: 30px 16px; }
.empty-state .mo { margin: 0 auto 10px; }
.pill-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; flex-wrap: wrap; }
.pill-tabs button, .pill-tabs a { border: 0; background: transparent; cursor: pointer; font-weight: 700; padding: 7px 14px; border-radius: 999px; color: var(--char-80); text-decoration: none; font-size: .92rem; }
.pill-tabs [aria-pressed="true"], .pill-tabs .active { background: var(--red); color: #fff; }

.mo-say.no-av .bubble { border-radius: 18px; }

/* ---------- Onboarding & who ---------- */
.ob { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 30px 0; }
.ob-card { position: relative; width: min(640px, 100%); border-top: 8px solid var(--red); padding: clamp(22px, 4vw, 40px); }
.ob-mo { display: flex; justify-content: center; margin-top: -10px; }
.ob-mo .mo { animation: moPop .5s ease both; }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--char-20); transition: width .2s; }
.ob-dots i.on { width: 26px; background: var(--red); }
.ob-dots i.done { background: var(--red-40); }
.ob-say { justify-content: center; }
.ob-say .bubble { text-align: center; font-size: 1.2rem; padding-right: 46px; }
.ob-body { margin-top: 10px; }
.ob-big { font-size: 1.4rem; padding: 14px 16px; font-weight: 600; }
.ob-ages .pick-chip { font-size: 1.2rem; padding: 12px 22px; }
.ob-av { display: flex; justify-content: center; margin: 8px 0 14px; }
.ob-swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--char-20); cursor: pointer; }
.ob-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--char); }
.ob-sticker { width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--char-20); background: #fff; cursor: pointer; display: grid; place-items: center; }
.ob-sticker[aria-pressed="true"] { border: 3px solid var(--red); background: var(--red-10); }
.ob-back { position: absolute; left: 16px; top: 16px; border: 0; background: none; color: var(--char-80); font-weight: 700; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin-top: 14px; }
.who-tile { border: 1px solid var(--char-10); background: #fff; border-radius: 16px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; color: var(--char); font-size: 1.1rem; transition: transform .15s, box-shadow .15s; }
.who-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------- Today ---------- */
.td-hero { margin-top: 24px; display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--char-10); border-top: 8px solid var(--red); box-shadow: var(--shadow); border-radius: 22px; padding: clamp(18px, 4vw, 40px); }
.td-mo { display: flex; justify-content: center; }
.td-talk .mo-say { margin-top: 0; }
.td-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 14px 0 16px; }
.td-face { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; font-size: .82rem; color: var(--char); background: #fff; border-radius: 14px; padding: 8px 4px; box-shadow: var(--shadow-sm); transition: transform .15s; }
.td-face img { width: 100%; max-width: 64px; }
.td-face:hover { transform: translateY(-4px) scale(1.03); }
.td-progress { font-weight: 700; color: var(--char-80); }
.td-progress b { color: var(--red); font-family: var(--font-display); font-size: 1.3rem; }
.td-plan { display: grid; gap: 12px; margin-top: 12px; }
.td-task { display: flex; align-items: center; gap: 16px; text-decoration: none; padding: 16px 20px; transition: transform .15s, box-shadow .15s; }
.td-task:hover { transform: translateX(4px); }
.td-task > .ico:last-child { color: var(--char-40); margin-left: auto; }
.td-num { width: 40px; height: 40px; border-radius: 12px; background: var(--char-5); color: var(--char); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; flex: none; }
.td-task.done { background: var(--green-20); border-color: var(--green); }
.td-task.done .td-num { background: var(--green-ink); color: #fff; }
.td-txt { display: flex; flex-direction: column; }
.td-txt b { font-size: 1.1rem; color: var(--char); }
.td-txt span { color: var(--char-80); font-size: .92rem; }
.td-task.done .td-txt b { text-decoration: line-through; text-decoration-color: var(--green-ink); }
.td-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.td-stat { text-align: center; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 10px; }
.td-stat b { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; color: var(--red); }
.td-stat span { font-size: .85rem; font-weight: 600; color: var(--char-80); }
.td-continue { display: flex; gap: 18px; align-items: center; text-decoration: none; border-left: 6px solid var(--c); }
.td-continue img { width: 120px; height: 90px; object-fit: contain; flex: none; }
.td-continue h3 { margin: 4px 0; }
.td-continue > .ico { margin-left: auto; color: var(--red); }

/* ---------- Talk ---------- */
.tk { max-width: 820px; margin: 18px auto 0; }
.tk-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border: 1px solid var(--char-10); border-radius: 16px; box-shadow: var(--shadow-sm); position: sticky; top: 76px; z-index: 5; }
.tk-head b { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; color: var(--red); display: block; line-height: 1; }
.tk-head span { font-size: .85rem; color: var(--char-80); font-weight: 600; }
.tk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; }
.tk-thread { padding: 16px 0 40px; display: flex; flex-direction: column; gap: 4px; min-height: 50vh; }
.tk-row.mo .mo-say { margin: 6px 0; }
.tk-typing .bubble { padding: 16px 20px; display: flex; gap: 5px; }
.tk-typing .bubble i { width: 8px; height: 8px; border-radius: 50%; background: var(--char-40); animation: tkDot 1s infinite; }
.tk-typing .bubble i:nth-child(2) { animation-delay: .15s; }
.tk-typing .bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes tkDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.tk-kid { display: flex; justify-content: flex-end; align-items: flex-end; gap: 10px; margin: 6px 0; animation: fadeIn .3s ease both; }
.tk-kid .bubble { background: var(--red); color: #fff; border-radius: 18px 18px 6px 18px; padding: 11px 16px; max-width: 520px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-kid .bubble b { font-weight: 800; }
.tk-face { width: 30px; height: 32px; background: #fff; border-radius: 50%; padding: 2px; }
.tk-row.kid-card { display: flex; justify-content: flex-end; }
.tk-card { width: min(640px, 100%); margin: 6px 0 6px auto; border-top: 4px solid var(--red); animation: fadeIn .3s ease both; }
.tk-mocard { margin: 4px 0 8px 60px; max-width: 640px; animation: fadeIn .3s ease both; }
.tk-q { font-weight: 700; margin-bottom: 8px; }
.tk-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tk-facebtn { border: 2px solid transparent; background: var(--char-5); border-radius: 14px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: .82rem; color: var(--char); transition: transform .12s, border-color .12s; }
.tk-facebtn img { width: 100%; max-width: 60px; }
.tk-facebtn:hover, .tk-facebtn:focus-visible { border-color: var(--c); transform: translateY(-3px); }
.tk-wheelbtn { margin-top: 12px; }
.tk-wheel { margin-top: 10px; }
.tk-wheel .wheel-svg { max-width: 460px; }
.tk-sizes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-size { border: 1px solid var(--char-20); background: #fff; border-radius: 12px; padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 120px; text-align: left; color: var(--char); }
.tk-size:hover, .tk-size:focus-visible { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.tk-size b { font-size: 1.05rem; }
.tk-size small { color: var(--char-80); font-size: .78rem; max-width: 180px; }
.tk-bars { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.tk-bars i { width: 6px; background: var(--char-10); border-radius: 2px; }
.tk-bars i:nth-child(1) { height: 5px; }
.tk-bars i:nth-child(2) { height: 7px; }
.tk-bars i:nth-child(3) { height: 9px; }
.tk-bars i:nth-child(4) { height: 11px; }
.tk-bars i:nth-child(5) { height: 13px; }
.tk-bars i:nth-child(6) { height: 15px; }
.tk-bars i:nth-child(7) { height: 16px; }
.tk-bars i.on { background: var(--c); }
.tk-private { font-size: .82rem; margin: 8px 0 0; display: flex; gap: 6px; align-items: center; }
.tk-mic.on { background: var(--red); color: #fff; border-color: var(--red); }
.tk-mic.on .ico { color: #fff; }
.tk-tool { display: flex; gap: 14px; align-items: center; }
.tk-tool b { display: block; font-size: 1.15rem; }
.tk-tool span { color: var(--char-80); font-size: .92rem; }
.tk-toolbox { background: #fff; border: 1px solid var(--char-10); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; }
.tk-talkcard { display: flex; gap: 12px; align-items: center; background: var(--yellow-20); border-radius: 14px; padding: 14px 16px; font-size: 1.1rem; }
.tk-talkcard p { margin: 0; }
.tk-end { justify-content: center; }

/* ---------- Me ---------- */
.me-hero { margin-top: 24px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--char-10); border-top: 8px solid var(--red); border-radius: 20px; padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
.me-id { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.me-id h1 { margin: 0; }
.me-meta { font-weight: 600; color: var(--char-80); margin: 2px 0 12px; }
.me-mo { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.me-ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 12px; }
.me-badge { background: #fff; border: 1px dashed var(--char-20); border-radius: 14px; padding: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--char-60); }
.me-badge .illo { filter: grayscale(1) opacity(.35); }
.me-badge b { color: var(--char-60); }
.me-badge span { font-size: .8rem; }
.me-badge.got { border: 1px solid var(--char-10); border-top: 4px solid var(--red); box-shadow: var(--shadow-sm); color: var(--char-80); }
.me-badge.got .illo { filter: none; }
.me-badge.got b { color: var(--char); }
.me-badge-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--char-5); display: grid; place-items: center; }
.me-badge.got .me-badge-ic { background: var(--red-10); }

/* ---------- Shop ---------- */
.shop { display: grid; grid-template-columns: 340px 1fr; gap: 24px; margin-top: 20px; align-items: start; }
.shop-stage { position: sticky; top: 90px; text-align: center; border-top: 8px solid var(--red); }
.shop-mo { display: flex; justify-content: center; }
.shop-bal { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.shop-bal b { font-family: var(--font-display); font-size: 2.4rem; color: var(--red); }
.shop-bal span { font-weight: 600; color: var(--char-80); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 26px; }
.shop-item { border: 1px solid var(--char-10); background: #fff; border-radius: 14px; padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--char); box-shadow: var(--shadow-sm); transition: transform .12s; }
.shop-item:hover { transform: translateY(-3px); }
.shop-item span { font-size: .8rem; color: var(--char-80); display: inline-flex; gap: 4px; align-items: center; }
.shop-item span .ico { color: #E0B42E; }
.shop-item.on { border: 2px solid var(--red); background: var(--red-10); }

/* ---------- Grown-ups ---------- */
.ga-list { padding-left: 18px; margin: 0; }
.ga-list li { margin-bottom: 8px; }
.ga-prof .row { margin-bottom: 8px; }
.btn.danger { background: var(--red); color: #fff; }

@media (max-width: 860px) {
  .td-hero { grid-template-columns: 1fr; }
  .td-mo .mo { width: 130px; height: 130px; }
  .td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-hero { grid-template-columns: 1fr; }
  .shop { grid-template-columns: 1fr; }
  .shop-stage { position: static; }
}
@media (max-width: 560px) {
  .td-faces, .tk-faces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tk-mocard { margin-left: 0; }
  .mo-say .mo-av .mo { width: 52px; height: 52px; }
  .td-continue img { width: 80px; height: 64px; }
}
.stars-pill { text-decoration: none; }
.tk-facebtn img.tk-face { width: 100%; max-width: 58px; height: auto; aspect-ratio: 1 / 1; background: none; padding: 0; border-radius: 0; }
a.icon-btn { text-decoration: none; }
.lang-btn { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; cursor: pointer; font-weight: 800; font-size: .78rem; }
.lang-btn span { padding: 4px 8px; border-radius: 999px; color: var(--char-60); }
.lang-btn span.on { background: var(--red); color: #fff; }
.ob-lang { justify-content: center; margin: 4px 0 14px; }
