/* QAQA Mini App — compact Telegram-native layout. This does not affect qaqa.ru. */
:root {
  --mint:#f4f5f5;
  --ink:#17201d;
  --muted:#7a8580;
  --card:#fff;
  --glass:rgba(255,255,255,.94);
  --line:#e7ebea;
  --accent:#14a97a;
  --soft:#eaf7f0;
}
:root[data-theme=dark] {
  --mint:#101714;
  --ink:#f3f8f5;
  --muted:#a3b4a9;
  --card:#1d2923;
  --glass:rgba(28,40,33,.94);
  --line:#34443a;
  --accent:#77e8b0;
  --soft:#233b2d;
}
html,body{background:var(--mint);color:var(--ink)}
body,:root[data-theme=dark] body{background:var(--mint)}
body:has(#page-home:not([hidden])){background:linear-gradient(180deg,#20cd8a 0,#74edb9 250px,var(--mint) 455px,var(--mint) 100%)}
:root[data-theme=dark] body:has(#page-home:not([hidden])){background:linear-gradient(180deg,#087554 0,#1b5541 250px,var(--mint) 455px,var(--mint) 100%)}
.ambient{display:none}
.app-shell{width:min(700px,100%);padding:calc(12px + var(--safe-top)) 16px calc(106px + var(--safe-bottom))}
.home-controls{height:42px;margin:0 0 8px;align-items:center}
.model-selector{height:38px;max-width:min(70%,300px);background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:20px;padding:0 12px;box-shadow:none;backdrop-filter:none}
.model-selector-copy strong{font-size:13px;font-weight:650}
.selector-arrow{color:var(--muted)}
.upgrade-button{height:37px;min-width:105px;border-radius:19px;background:var(--card);color:var(--ink);border:1px solid var(--line);box-shadow:none;font-weight:650}
.upgrade-button span{color:var(--accent)}
.agent-hero{padding:11px 8px 10px;text-align:center}
.hero-frog{width:112px;height:112px;margin:0 auto 5px;filter:drop-shadow(0 10px 11px rgba(5,76,45,.13))}
.hero-frog{animation:qaqa-frog-breathe 3.8s ease-in-out infinite;transform-origin:50% 70%}
.agent-hero h1,:root[data-theme=dark] .agent-hero h1{font-size:29px;line-height:1.16;margin:3px 0;color:var(--ink);font-weight:720}
.section-block{margin-top:22px}
.section-heading{margin:0 1px 10px}
.section-heading h2{font-size:18px;letter-spacing:-.025em}
.section-heading p{margin:4px 0 0;color:var(--muted);font-size:12px}
.section-heading .text-button{font-size:13px;font-weight:650}
.discovery-list,.settings-list,.tool-grid{border:1px solid var(--line);border-radius:18px;background:var(--card);padding:0 14px;box-shadow:none}
.discovery-list>button{min-height:67px;padding:11px 0;gap:11px}
.discovery-list>button{animation:qaqa-card-in .42s both}
.discovery-list>button:nth-child(2){animation-delay:.07s}
.discovery-list>button:nth-child(3){animation-delay:.14s}
.discovery-list>button>span:first-child{width:37px;height:37px;border-radius:11px;background:var(--soft);color:var(--accent)}
.discovery-list strong,.tool-copy strong{font-size:14px;font-weight:660}
.discovery-list small,.tool-copy small{font-size:11px;margin-top:2px;line-height:1.35}
.discovery-list b{font-size:20px;color:#a8b1ab}
.return-chat#openChatButton{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:46px;margin:15px 0 0;border:0;border-radius:15px;background:linear-gradient(115deg,#17bd89,#07986f);color:#fff;font-size:14px;font-weight:760;box-shadow:0 8px 18px rgba(0,124,83,.16)}
.return-chat#openChatButton span{font-size:20px;line-height:1}
.home-skills{margin-top:25px}
.reward-banner{margin:18px 0 0;padding:14px 15px;border-radius:17px;background:linear-gradient(110deg,#1eaf83,#0c8a6e);box-shadow:none}
.reward-banner>span:first-child{width:35px;height:35px;border-radius:11px;display:grid;place-items:center;background:#ffffff24}
.reward-banner svg{width:20px;height:20px}
.reward-banner strong{font-size:13px}.reward-banner small{font-size:11px;margin-top:2px}
.bottom-nav{height:68px;width:min(510px,calc(100% - 24px));bottom:calc(8px + var(--safe-bottom));background:var(--glass);border:1px solid var(--line);border-radius:25px;padding:5px;box-shadow:0 7px 25px rgba(15,34,22,.12);gap:0}
.bottom-nav button{border-radius:19px;min-height:55px;gap:2px}
.bottom-nav button,.tool-card,.creation-launch,.primary-button{transition:transform .2s ease,background-color .2s ease,box-shadow .2s ease}
.bottom-nav button:active,.tool-card:active,.creation-launch:active,.primary-button:active{transform:scale(.97)}
.bottom-nav button.active{color:var(--accent);background:var(--soft)}
.bottom-nav button svg{width:20px;height:20px}
.bottom-nav button small{font-size:9px}
.bottom-nav .create-nav span{width:36px;height:29px;border-radius:10px;background:linear-gradient(130deg,#39d49b,#08a277);color:white;box-shadow:none}
.bottom-nav .create-nav.active span{color:white}
.page-header{height:47px;margin-bottom:3px;padding:0}
.brand img{width:35px;height:35px}
.brand strong{font-size:18px}.brand small{font-size:10px}
.compact-upgrade{height:32px;min-height:32px;border-radius:12px;background:var(--soft);color:var(--accent);box-shadow:none}
.page-intro{padding:13px 1px 16px}
.page-intro h1{font-size:31px}.page-intro p:not(.eyebrow){font-size:13px;margin-top:7px}
.search-box{min-height:45px;height:45px;border-radius:13px;background:var(--card);border:1px solid var(--line)}
.search-box:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 13%,transparent)}
.filter-row{padding-top:11px}.filter-chip{padding:8px 12px;font-size:11px}
.filter-chip.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.tool-sections{gap:18px;margin-top:16px}.tool-section-head h2{font-size:16px}
.tool-grid{padding:0 14px;display:flex;flex-direction:column;gap:0}
.tool-card{min-height:66px;padding:10px 0;gap:11px}
.tool-icon{width:38px;height:38px;border-radius:10px;background:var(--soft);color:var(--accent)}
.tool-card .tool-status{position:static;display:block;margin:3px 0 0;font-size:10px;font-weight:650}
.tool-card b{font-size:21px;color:var(--muted)}
.tool-copy{flex:1;min-width:0}.tool-copy small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.studio-balance{width:100%;height:52px;display:flex;align-items:center;gap:8px;padding:0 15px;margin-bottom:15px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--ink);text-align:left}
.studio-balance span{font-size:12px;color:var(--muted)}.studio-balance strong{font-size:19px}.studio-balance b{margin-left:auto;color:var(--accent);font-size:11px}
.creation-launch-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.creation-launch,.creation-launch.featured{min-height:136px;padding:13px;border-radius:18px;background:var(--card);color:var(--ink);border:1px solid var(--line);box-shadow:none}
.creation-launch.featured{background:linear-gradient(155deg,var(--card),var(--soft));border-color:color-mix(in srgb,var(--accent) 24%,var(--line))}
.creation-launch.featured p{color:var(--muted)}
.creation-icon{width:40px;height:40px;border-radius:11px;margin-bottom:10px;background:var(--soft);color:var(--accent)}
.creation-launch strong{font-size:14px;line-height:1.2}.creation-launch p{font-size:11px;line-height:1.3;margin:3px 0 0}
.creation-launch>b,.creation-launch.featured>b{font-size:16px;background:none;color:var(--muted);padding:0;right:14px;top:15px}
.template-gallery{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.template-tile{height:188px;position:relative;padding:0;overflow:hidden;border-radius:17px;background:var(--card);border:1px solid var(--line);text-align:left}
.template-tile{grid-column:span 2}
.template-tile img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .25s ease}
.template-tile:hover img{transform:scale(1.04)}
.template-tile:after{content:"";position:absolute;inset:45% 0 0;background:linear-gradient(transparent,#0a1615bc)}
.template-tile span{position:absolute;z-index:1;bottom:11px;left:11px;right:8px;color:#fff;font-size:13px;font-weight:720;text-shadow:0 1px 3px #0006}
.template-tile.wide{height:185px;grid-column:span 3}
.template-sheet>img{width:100%;max-height:290px;object-fit:cover;border-radius:14px;margin:12px 0}
.template-sheet>p{font-size:13px;line-height:1.5;color:var(--muted)}
.template-disclaimer{font-size:11px!important}.template-actions{display:flex;gap:8px;margin-top:15px}.template-actions>button{min-height:43px;flex:1;padding:9px;border-radius:13px;background:var(--soft);color:var(--ink);font-size:12px;font-weight:700}.template-actions>.primary-button{background:var(--accent);color:#fff}
.profile-identity{display:flex;align-items:center;gap:12px;padding:19px 3px 7px}
.profile-identity img{background:var(--soft);border-radius:15px;padding:4px;object-fit:contain}
.profile-identity h1{font-size:22px;margin:0;letter-spacing:-.025em}.profile-identity p{font-size:12px;color:var(--muted);margin:4px 0 0}
.settings-group{margin-top:23px}.settings-group h2{font-size:12px;font-weight:660;letter-spacing:.02em;color:var(--muted);margin:0 14px 8px}
.settings-list{padding:0 12px}.settings-list>button,.settings-list>a,.settings-list>.theme-setting{min-height:61px;padding:8px 0;gap:10px}
.settings-list>button>span,.settings-list>a>span,.settings-list>.theme-setting>span{width:35px;height:35px;border-radius:10px;flex:none;background:var(--soft);color:var(--accent)}
.settings-list svg{width:19px;height:19px}.settings-list strong{font-size:13px}.settings-list small{font-size:11px;line-height:1.3}
.settings-list b{color:var(--muted);font-weight:450;font-size:20px}.settings-list em{font-style:normal;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11px}
.theme-setting select{width:112px;min-height:35px;padding:5px 7px;font-size:11px!important}
.model-popover{position:fixed;z-index:1000;inset:auto;left:var(--popover-left,12px);top:var(--popover-top,65px);transform:none;width:min(370px,calc(100% - 24px));max-height:min(65dvh,510px);margin:0;padding:12px;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:17px;box-shadow:0 18px 50px #0a241e38;overflow:hidden}
.model-popover-head{margin-bottom:7px;align-items:center}.model-popover-head small{font-size:9px;color:var(--muted)}.model-popover-head h2{font-size:15px;margin:2px 0 0}.model-popover-head>button{width:30px;height:30px;border-radius:9px;background:var(--soft);color:var(--ink);font-size:18px}
.model-search{margin:5px 0 7px;height:38px;min-height:38px;background:var(--soft);border:0;padding:0 11px}.model-search input{color:var(--ink);font-size:14px!important}
.model-hint{font-size:10px;line-height:1.3;color:var(--muted);margin:5px 0 9px;padding:0 2px}
.model-list{gap:11px;max-height:calc(min(65dvh,510px) - 115px);padding:0 2px 2px 0}
.model-group{gap:2px}.model-group h3{position:static;background:none;color:var(--muted);font-size:10px;letter-spacing:.04em;margin:2px 2px 3px;padding:0}
.model-option{min-height:47px;padding:5px;grid-template-columns:32px minmax(0,1fr) auto;gap:7px;border:0;border-radius:10px;background:transparent;color:var(--ink)}
.model-option.selected{background:var(--soft);box-shadow:none;border:0}
.model-option:hover{background:var(--soft)}
.model-option .model-symbol{width:32px;height:32px;border-radius:9px;background:var(--soft);color:var(--ink)}
.model-option .model-symbol img{max-width:23px;max-height:23px;object-fit:contain}
.model-option strong{font-size:12px}.model-option small{font-size:10px;color:var(--muted);margin-top:2px}
.model-option .tier-badge{font-size:9px;padding:5px;background:var(--soft);color:var(--accent)}
.model-option[data-model-locked=true]{opacity:.58}
.sheet,.onboarding{background:var(--mint);color:var(--ink)}
.primary-button{background:var(--accent);color:#fff;box-shadow:none}
.loading-screen{background:var(--mint)}
@keyframes qaqa-frog-breathe{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-6px) scale(1.025)}}
@keyframes qaqa-card-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.hero-frog,.discovery-list>button{animation:none}.bottom-nav button,.tool-card,.creation-launch,.primary-button{transition:none}}
@media(max-width:430px){.app-shell{padding-left:14px;padding-right:14px}.hero-frog{width:106px;height:106px}.agent-hero h1{font-size:27px}.creation-launch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.creation-launch{min-height:136px}.model-popover{padding:12px}.model-option{grid-template-columns:32px minmax(0,1fr) auto;padding:5px}.model-option .model-symbol{width:32px;height:32px}}
@media(max-width:350px){.app-shell{padding-left:10px;padding-right:10px}.model-selector{max-width:64%}.upgrade-button{min-width:84px;padding:0 8px}.template-tile{height:155px}.creation-launch strong{font-size:12px}}
@media(min-width:761px){.app-shell{padding-left:24px;padding-right:24px}.bottom-nav{bottom:15px}.template-tile,.template-tile.wide{height:205px}}
