/* Browser adaptation of Coopanion's outlined floating tools and dressing cards.
   Keep these rules inside the pet: the study room retains its own glass theme. */
#study-pet{--pet-ink:#1b1626;--pet-muted:#787386;--pet-line:#dfdce8;--pet-accent:#4d6bfe;--pet-surface:#fff;--pet-shadow:rgba(23,17,43,.18)}
#study-pet.menu-visible,#study-pet.chat-visible,#study-pet.care-visible{z-index:50}
#study-pet .pet-tools{position:absolute;display:grid;grid-template-rows:repeat(3,40px);grid-auto-flow:column;gap:7px;pointer-events:none;opacity:0;transform:translateY(4px);transition:opacity .16s,transform .16s;z-index:3}
#study-pet .pet-tools.is-visible,#study-pet .pet-tools:focus-within{pointer-events:auto;opacity:1;transform:none}
#study-pet .pet-tool{position:static;width:40px;height:40px;display:grid;place-items:center;padding:0;border:2px solid var(--pet-ink);border-radius:50%;background:#fff;color:var(--pet-ink);box-shadow:0 3px 0 var(--pet-shadow);opacity:1;transform:none;letter-spacing:0;pointer-events:none;cursor:pointer;transition:color .15s,border-color .15s,transform .15s}
#study-pet .pet-tools.is-visible .pet-tool,#study-pet .pet-tools:focus-within .pet-tool{pointer-events:auto}
#study-pet .pet-tool svg{display:block;width:21px;height:21px}
#study-pet .pet-tool:hover,#study-pet .pet-tool[aria-pressed=true]{color:var(--pet-accent);border-color:var(--pet-accent)}
#study-pet .pet-tool:active{transform:translateY(2px);box-shadow:0 1px 0 var(--pet-shadow)}
#study-pet button:focus-visible{outline:3px solid #8c9eff;outline-offset:3px}
#study-pet .study-pet-menu{width:394px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:16px;border:2px solid var(--pet-ink);border-radius:24px;background:var(--pet-surface);box-shadow:0 5px 0 var(--pet-shadow),0 16px 38px #18102b20;color:var(--pet-ink);backdrop-filter:none;z-index:4;scrollbar-color:#bcb8cc transparent;scrollbar-width:thin}
#study-pet .study-pet-menu header{justify-content:flex-start;gap:10px;padding-bottom:11px;margin:0;color:var(--pet-ink);font-size:15px}
#study-pet .study-pet-menu header>span{flex:1;min-width:0}
#study-pet .study-pet-menu header small{color:var(--pet-muted);font-size:11px;letter-spacing:0}
#study-pet .study-pet-menu header button{color:var(--pet-muted);flex-shrink:0}
#study-pet .study-pet-menu header button:hover{color:var(--pet-ink);background:#f2f0f7}
#study-pet .pet-menu-avatar{width:42px;height:42px;object-fit:contain;flex-shrink:0}
#study-pet .pet-panel-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:4px;margin-bottom:12px;border:1px solid var(--pet-line);border-radius:13px;background:#f5f4f8}
#study-pet .pet-panel-tabs button{padding:7px 10px;border-radius:9px;color:var(--pet-muted);font-size:12px;background:none}
#study-pet .pet-panel-tabs button[aria-pressed=true]{color:var(--pet-ink);background:#fff;box-shadow:0 1px 5px #18102b16;font-weight:550}
#study-pet #pet-home-panel .pet-growth-entry{border:1px solid var(--pet-line);border-radius:13px;background:#f8f7fc;color:var(--pet-ink);margin-bottom:10px}
#study-pet #pet-home-panel .pet-growth-entry small,#study-pet #pet-home-panel .pet-growth-entry [data-pet-care-bowls]{color:var(--pet-muted)}
#study-pet .study-pet-chat-open,#study-pet .study-pet-say{background:#f3f2f8;color:var(--pet-ink);border:1px solid var(--pet-line)}
#study-pet .study-pet-chat-open:hover,#study-pet .study-pet-say:hover{background:#eeecf7;border-color:#b9b2d2}
#study-pet .study-pet-chat-open span{color:var(--pet-muted)}
#study-pet .study-pet-actions{grid-template-columns:repeat(3,1fr);gap:7px}
#study-pet .study-pet-actions button{border:1px solid var(--pet-line);background:#fff;color:var(--pet-ink);padding:9px 4px;font-size:12px}
#study-pet .study-pet-actions button:hover{border-color:var(--pet-accent);color:var(--pet-accent);background:#f6f7ff}
#study-pet .study-pet-size{background:#f7f6fa;border:1px solid var(--pet-line);border-radius:13px;color:var(--pet-ink)}
#study-pet .pet-size-heading,#study-pet .pet-size-heading output,#study-pet .pet-size-footer button{color:var(--pet-ink)}
#study-pet .pet-size-footer{color:var(--pet-muted)}
#study-pet input[type=range]{accent-color:var(--pet-accent)}
#study-pet .study-pet-menu footer{border-top:1px solid var(--pet-line);color:var(--pet-muted)}
#study-pet .study-pet-menu footer button{color:var(--pet-muted)}
#study-pet .pet-dress-preview{height:172px;position:relative;background:radial-gradient(circle at 50% 70%,#fff 0,#f2f0fa 70%);border:1px solid var(--pet-line);border-radius:16px;overflow:hidden}
#study-pet #pet-preview-body{position:absolute;inset:0 0 17px;pointer-events:none}
#study-pet #pet-dress-status{position:absolute;bottom:8px;left:8px;right:8px;text-align:center;font-size:10px;color:var(--pet-muted)}
#study-pet #pet-dress-panel h3{margin:12px 0 7px;font-size:12px;font-weight:550}
#study-pet .pet-palette-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
#study-pet .pet-outfit-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#study-pet .pet-dress-option{display:flex;align-items:center;flex-direction:column;gap:4px;min-width:0;padding:6px 2px;border:1.5px solid var(--pet-line);border-radius:12px;background:#fff;color:var(--pet-muted);font-size:10px}
#study-pet .pet-dress-option img{width:40px;height:43px;object-fit:contain;display:block}
#study-pet .pet-dress-option span{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#study-pet .pet-dress-option:hover{border-color:#a7afff;color:var(--pet-accent)}
#study-pet .pet-dress-option[aria-pressed=true]{border-color:var(--pet-accent);color:var(--pet-accent);background:#f4f5ff;box-shadow:0 0 0 1px #4d6bfe12}
#study-pet .pet-sound-row{display:flex;align-items:center;gap:8px;min-height:51px;padding:10px 0;border-bottom:1px solid var(--pet-line);color:var(--pet-ink);font-size:12px}
#study-pet .pet-sound-row>span{flex:1;min-width:65px}
#study-pet .pet-sound-row small{display:block;font-size:10px;color:var(--pet-muted);margin-top:4px}
#study-pet .pet-sound-row input[type=range]{min-width:0;width:42%;flex-shrink:1}
#study-pet .pet-sound-row output{min-width:43px;text-align:right;font-size:10px;color:var(--pet-muted)}
#study-pet .pet-sound-row input[type=checkbox]{appearance:none;width:34px;height:20px;border-radius:15px;background:#d8d5e2;position:relative;cursor:pointer;flex-shrink:0}
#study-pet .pet-sound-row input[type=checkbox]:before{content:"";position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:50%;background:white;transition:transform .15s}
#study-pet .pet-sound-row input[type=checkbox]:checked{background:var(--pet-accent)}
#study-pet .pet-sound-row input[type=checkbox]:checked:before{transform:translateX(14px)}
#study-pet .pet-sound-categories{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding:12px 0;border-bottom:1px solid var(--pet-line)}
#study-pet .pet-sound-categories label{display:flex;align-items:center;justify-content:center;gap:6px;padding:7px 3px;border:1px solid var(--pet-line);border-radius:9px;color:var(--pet-muted);font-size:11px;cursor:pointer}
#study-pet .pet-sound-categories input{accent-color:var(--pet-accent)}
#study-pet #pet-sound-preview{display:flex;align-items:center;justify-content:center;gap:8px;margin:17px auto 10px;padding:9px 18px;border:1.5px solid var(--pet-ink);border-radius:30px;color:var(--pet-ink);background:#fff;font-size:12px;box-shadow:0 2px 0 var(--pet-shadow)}
#study-pet #pet-sound-preview svg{width:17px;height:17px}
#study-pet .pet-sound-note{font-size:10px;text-align:center;color:var(--pet-muted);margin:6px 0 13px}
#study-pet .study-pet-bubble{padding:12px 16px;border:2px solid var(--pet-ink);border-radius:20px;background:#fff;color:var(--pet-ink);box-shadow:0 4px 0 var(--pet-shadow);backdrop-filter:none;font-size:13px}
#study-pet .study-pet-bubble:after{content:"";position:absolute;bottom:-7px;left:calc(50% - 6px);width:11px;height:11px;background:#fff;border-right:2px solid var(--pet-ink);border-bottom:2px solid var(--pet-ink);transform:rotate(45deg)}
#study-pet .pet-timer-bubble{border:1.5px solid var(--pet-ink);background:#fff;color:var(--pet-ink);box-shadow:0 3px 0 var(--pet-shadow)}
#study-pet .pet-timer-dot{background:var(--pet-accent)}
#study-pet .study-pet-chat{border:2px solid var(--pet-ink);background:#fff;color:var(--pet-ink);box-shadow:0 5px 0 var(--pet-shadow),0 14px 40px #18102b25;backdrop-filter:none}
#study-pet .pet-chat-header{border-color:var(--pet-line)}
#study-pet .pet-chat-header h2,#study-pet .pet-chat-input{color:var(--pet-ink)}
@media(max-width:480px){#study-pet .study-pet-menu{padding:13px;width:350px}#study-pet .pet-tools{grid-template-rows:repeat(3,35px);gap:6px}#study-pet .pet-tool{width:35px;height:35px}#study-pet .pet-tool svg{width:18px;height:18px}#study-pet .pet-dress-preview{height:145px}#study-pet .pet-dress-option img{height:36px;width:35px}#study-pet .pet-dress-option{font-size:9px}}
@media(prefers-reduced-motion:reduce){#study-pet .pet-tools,#study-pet .pet-tool,#study-pet .pet-sound-row input:before{transition:none}}
