/* Reset legacy fixed/minimum heights all the way down the conversation chain. */
@media(max-width:860px) {
 #ai .ai-main-panel { height:calc(var(--sky-visible-height,100dvh) - 142px - env(safe-area-inset-bottom)); min-height:0; }
 #ai .ai-composer-head { display:none; }
 #ai .ai-composer-head h2 { font-size:16px; line-height:1.4; }
 #ai .ai-composer-head .workspace-status { white-space:nowrap; padding:6px 10px; }
 #ai .ai-conversation { flex:1 1 0; min-height:0; gap:0; overflow:hidden; }
 #ai .ai-conversation-head { min-height:0; flex:0 0 auto; padding:8px 12px; }
 #ai .ai-conversation-head .ai-history-actions { margin:0 0 0 auto; }
 #ai #aiResults { flex:1 1 0; min-height:0; max-height:none; margin:0; padding:20px 16px; gap:20px; }
 #ai #aiPrompt { min-height:48px; height:48px; max-height:96px; padding:12px; resize:none; font-size:16px; line-height:1.5; }
 #ai .ai-composer { display:grid; grid-template-columns:42px minmax(0,1fr) 48px; align-items:center; gap:8px; padding:10px; min-height:0; border-inline:0; border-bottom:0; }
 #ai .ai-prompt-field { grid-column:2; grid-row:1; min-width:0; margin:0; gap:0; }
 #ai .ai-composer-options { grid-row:2; grid-column:1/-1; display:block; margin:0; }
 #ai .ai-web-toggle { display:flex; align-items:center; min-height:28px; margin:0; padding:0; border:0; background:transparent; font-size:14px; }
 #ai .ai-web-toggle input { width:18px; height:18px; min-width:18px; min-height:18px; padding:0; }
 #ai .ai-compose-actions { display:contents; }
 #ai .ai-visible-tools { grid-column:1; grid-row:1; display:flex; flex-direction:row; width:auto; margin:0; gap:0; }
 #ai .ai-plus-button { width:42px; height:42px; }
 #ai .ai-submit-button { grid-column:3; grid-row:1; width:48px; min-width:48px; height:48px; min-height:48px; padding:0; margin:0; border-radius:50%; font-size:0; }
 #ai .ai-submit-button::after { content:'↑'; font-size:26px; }
 body.mobile-conversation { position:fixed; inset:0; width:100%; overflow:hidden; overscroll-behavior:none; }
 body.mobile-conversation .mobile-dock,
 body.mobile-conversation .topbar,
 body.keyboard-open .mobile-dock { display:none; }
 #social.chat-focus {
  inset:auto; top:var(--sky-visible-top,0px); left:0; right:0; bottom:auto;
  height:var(--sky-visible-height,100dvh); min-height:0; max-height:var(--sky-visible-height,100dvh);
  width:100%; margin:0; padding:0; border:0; border-radius:0; box-sizing:border-box;
  overflow:hidden; animation:none; transform:none; filter:none;
 }
 #social.chat-focus .social-layout,
 #social.chat-focus .game-main,
 #social.chat-focus .social-panels,
 #social.chat-focus .social-panel.is-active,
 #social.chat-focus .social-panel.is-active .whatsapp-layout {
  display:flex !important; flex-direction:column; flex:1; width:100%; height:100%;
  min-height:0; max-height:none; margin:0; padding:0; gap:0; border:0; border-radius:0;
  box-sizing:border-box; overflow:hidden; animation:none; transform:none; filter:none;
 }
 #social.chat-focus .whatsapp-layout .social-chat-main {
  display:flex !important; flex-direction:column; flex:1 1 0; width:100%; height:100%;
  min-height:0; max-height:none; padding:0; margin:0; border:0; border-radius:0;
  overflow:hidden; box-sizing:border-box;
 }
 #social.chat-focus .whatsapp-layout .chat-log {
  display:block; flex:1 1 0; height:auto; min-height:0; max-height:none;
  margin:0; padding:24px 16px; border:0; border-radius:0; overflow-y:auto;
  overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
 }
 #social.chat-focus .chat-card-head { flex:0 0 auto; margin:0; min-height:64px; padding:calc(12px + env(safe-area-inset-top)) 16px 12px; }
 #social.chat-focus .chat-form {
  position:relative; top:auto; bottom:auto; flex:0 0 auto; width:100%; min-height:0;
  margin:0; padding:12px 12px calc(12px + env(safe-area-inset-bottom));
  border:0; border-top:1px solid #c7e3ff12; border-radius:0; box-sizing:border-box;
 }
 #social.chat-focus .chat-inline-status { margin:0; flex:0 0 auto; }
 body.keyboard-open #social.chat-focus .chat-form { padding-bottom:10px; }
 body.keyboard-open #social.chat-focus .chat-card-head { padding-top:12px; }
 body.keyboard-open #ai .ai-main-panel { height:calc(var(--sky-visible-height) - 96px); min-height:0; }
 #social .whatsapp-layout .social-thread-card { max-height:none; min-height:0; }
}

/* Game profiles: separate metrics instead of a single dense table. */
.group-manager { padding:24px; }
.group-manager label { display:flex; flex-direction:column; gap:10px; margin:18px 0; }
.group-manager select, .group-manager input { min-height:46px; font-size:16px; }
.group-manager .section-head h2 { font-size:22px; }
.managed-members { display:grid; gap:12px; margin:24px 0; }
.managed-members article { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; padding:18px; border:1px solid #c7e3ff18; border-radius:18px; background:#b4dfff08; }
.managed-members article small { margin-top:8px; font-size:14px; }
#social .chat-card-head h3 { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#social .chat-ai-button { width:38px; min-width:38px; height:42px; border-radius:50%; color:#d8eeff; padding:0; }
#social .chat-ai-notice { margin:0; flex:0 0 auto; padding:8px 16px; background:#0a1729d9; color:#91a7c0; font-size:12px; line-height:1.5; }
.player-stats-card { border-radius:24px; }
.player-stats-head { padding:30px 24px; gap:9px; }
.player-stat-grid { gap:16px; padding:24px; background:transparent; }
.player-stat-grid > div { min-height:120px; padding:24px 18px; gap:12px; border:1px solid #c7e3ff18; border-radius:18px; background:rgba(7,15,27,.84); }
.player-stat-grid span { font-size:14px; line-height:1.5; }
.player-stat-grid strong { line-height:1.25; overflow-wrap:anywhere; }
.mode-stats { margin:0 24px 24px; padding:22px; border-radius:20px; }
.mode-stat-row { min-height:64px; padding:12px 0; gap:16px; font-size:14px; }
.apex-profile-section { margin:24px; padding:24px; border-radius:20px; }
.apex-legends-grid { gap:18px; margin-top:24px; }
.apex-legend-card { padding:22px; border-radius:18px; }
.apex-legend-card > div { padding:12px 0; gap:18px; }
@media(max-width:600px) {
 .player-stat-grid { gap:14px; padding:18px; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .player-stat-grid > div { min-height:116px; padding:22px 12px; }
 .player-stats-head { padding:26px 18px; }
 .mode-stats, .apex-profile-section { margin:4px 18px 24px; padding:20px 16px; }
 .mode-stat-row { grid-template-columns:1fr; gap:10px; padding:18px 0; }
 .mode-stat-row span { display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; }
 .apex-legends-grid { grid-template-columns:1fr; }
 .apex-legend-card { padding:20px; }
 .embedded-game .mobile-menu-toggle { position:fixed; display:flex; left:50%; bottom:12px; top:auto; transform:translateX(-50%); margin:0; z-index:51; }
 .embedded-game .view-tabs { bottom:76px; max-height:calc(100dvh - 110px); overflow:auto; }
 .embedded-game .app-shell { padding-bottom:92px; }
 .embedded-game { scroll-padding-bottom:92px; }
}

.control-app-features { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.control-app-card { margin-bottom:24px; }
.control-app-features button { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:76px; padding:16px; border:1px solid #c7e3ff24; border-radius:18px; background:#091727dd; text-align:left; color:#d8eeff; }
.control-app-features strong { display:block; font-size:16px; }
.control-app-features small { display:block; margin-top:6px; font-size:14px; color:#91a7c0; }
.control-app-features .app-switch { display:flex; align-items:center; padding:4px; width:46px; min-width:46px; height:26px; border-radius:20px; background:#506078; }
.control-app-features .app-switch::after { content:''; width:18px; height:18px; border-radius:50%; background:#fff; transition:transform .2s; }
.control-app-features [aria-checked=true] .app-switch { background:#2b9765; }
.control-app-features [aria-checked=true] .app-switch::after { transform:translateX(20px); }
.app-feature-disabled { opacity:.5; }
.app-paused { padding:24px; border:1px solid #c7e3ff24; border-radius:20px; background:#0a1729dd; color:#d8eeff; line-height:1.6; }
.app-disabled > :not(.app-paused) { display:none !important; }
.app-disabled > .app-paused { display:block; }
.app-paused[hidden] { display:none; }
@media(max-width:600px) { .control-app-features { grid-template-columns:1fr; } }
