.web-pet, .web-pet * { box-sizing:border-box; }
.web-pet [hidden] { display:none !important; }
.web-pet { --pet-width:150px; --pet-height:190px; position:fixed; left:0; top:0; z-index:16; width:var(--pet-width); height:var(--pet-height); font:13px/1.65 var(--sans,system-ui,sans-serif); color:#eee7fb; user-select:none; -webkit-user-select:none; transition:opacity .2s; }
.web-pet[data-blocked="true"] { visibility:hidden; pointer-events:none; }
.pet-avatar { position:relative; width:100%; height:100%; padding:0; border:0; background:transparent; cursor:grab; touch-action:none; -webkit-tap-highlight-color:transparent; }
.pet-avatar:active { cursor:grabbing; }
.pet-avatar:focus-visible { outline:1px dashed #dbc2ff; outline-offset:3px; border-radius:30px; }
.pet-avatar video,.pet-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center 38%; pointer-events:none; filter:drop-shadow(0 8px 9px #04031166); }
.pet-avatar video { opacity:0; transition:opacity .18s; }
.pet-avatar video[data-active="true"] { opacity:1; }
.pet-avatar img { object-fit:contain; }
.pet-actions { position:absolute; z-index:2; right:calc(100% - 8px); top:50%; display:flex; flex-direction:column; gap:7px; transform:translateY(-50%); }
.pet-actions button,.pet-restore { display:grid; place-items:center; flex:none; width:35px; height:35px; padding:8px; border:1px solid #c4a3ec42; border-radius:50%; background:#1d1835ed; color:#bcd2ff; box-shadow:0 4px 15px #0003; backdrop-filter:blur(12px); cursor:pointer; transition:transform .18s,background .18s; }
.pet-actions button:hover,.pet-restore:hover { transform:scale(1.08); background:#392953f5; }
.pet-actions button:focus-visible,.pet-restore:focus-visible,.pet-chat :focus-visible,.pet-settings :focus-visible { outline:2px solid #d9b3ff; outline-offset:3px; }
.pet-actions button:disabled { opacity:.45; cursor:wait; }
.pet-actions svg,.pet-chat svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.pet-actions button:nth-child(2) { color:#7fd7d9; }
.pet-actions .pet-hide { width:27px; height:27px; padding:5px; margin-inline:auto; color:#a99bbf; }
.pet-bubble { position:absolute; z-index:3; left:var(--bubble-left,-72px); top:var(--bubble-top,-110px); width:230px; max-width:calc(100vw - 24px); max-height:min(260px,45vh); overflow:auto; padding:14px 17px; border:1px solid #c6a6e74d; border-radius:18px; background:linear-gradient(145deg,#27203cf5,#171328f5); color:#f2eafa; box-shadow:0 10px 35px #0004; text-align:center; overflow-wrap:anywhere; pointer-events:none; animation:pet-appear .2s ease both; }
.pet-chat { position:absolute; z-index:4; left:var(--chat-left,-130px); top:var(--chat-top,-250px); width:290px; max-width:calc(100vw - 24px); padding:12px; border:1px solid #bba0dd55; border-radius:17px; background:linear-gradient(145deg,#252037fa,#141020fa); box-shadow:0 16px 45px #0006; backdrop-filter:blur(20px); animation:pet-appear .2s ease both; user-select:text; -webkit-user-select:text; }
.pet-chat header { display:flex; align-items:center; gap:7px; padding:0 3px 10px; color:#f0e6fc; }
.pet-chat header strong { font-size:13px; font-weight:500; }
.pet-chat small { margin-left:auto; color:#a7a0bc; font-size:10px; }
.pet-chat button { border:0; cursor:pointer; color:#cfb8ef; background:transparent; }
.pet-chat header button { font-size:19px; padding:0 1px 0 5px; }
.pet-messages { max-height:min(220px,30dvh); min-height:65px; padding:4px 2px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#6b527e transparent; }
.pet-message { width:fit-content; max-width:95%; margin:0 0 8px; padding:8px 10px; border-radius:11px 11px 11px 3px; background:#ffffff08; color:#e1d7ed; font-size:12px; line-height:1.7; overflow-wrap:anywhere; white-space:pre-wrap; }
.pet-message[data-role="user"] { margin-left:auto; border-radius:11px 11px 3px 11px; background:#ad78db28; color:#f1e7fa; }
.pet-chat form { display:flex; gap:6px; align-items:center; margin-top:7px; padding:5px 6px 5px 11px; border:1px solid #b5a0c833; border-radius:11px; background:#06040d44; }
.pet-chat input { width:100%; min-width:0; border:0; outline:none; padding:5px 0; background:transparent; color:#f4eafa; font:inherit; font-size:13px; user-select:text; -webkit-user-select:text; }
.pet-chat input::placeholder { color:#aaa0b9; }
.pet-chat form button { display:grid; place-items:center; width:31px; height:31px; border-radius:8px; background:#8664a13d; }
.pet-chat form button:disabled { opacity:.4; cursor:wait; }
.pet-settings { position:absolute; z-index:5; left:var(--settings-left,-150px); top:var(--settings-top,-430px); width:330px; max-width:calc(100vw - 24px); max-height:var(--settings-max-height,calc(100dvh - 24px)); overflow:auto; overscroll-behavior:contain; padding:17px; border:1px solid #c5a8e559; border-radius:19px; background:linear-gradient(145deg,#292037fa,#141020fc); box-shadow:0 18px 55px #0007; backdrop-filter:blur(20px); user-select:text; -webkit-user-select:text; scrollbar-width:thin; scrollbar-color:#6b527e transparent; animation:pet-appear .2s ease both; }
.pet-settings header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:15px; }
.pet-settings header strong { display:block; color:#f1e5fc; font-size:15px; font-weight:500; letter-spacing:.05em; }
.pet-settings header span { display:block; margin-top:3px; color:#b4a3c5; font-size:11px; }
.pet-settings button { border:0; background:transparent; color:#d9c2ef; font:inherit; cursor:pointer; }
.pet-settings header button { font-size:22px; line-height:1; padding:0 2px; }
.pet-settings-enable { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; padding-bottom:12px; border-bottom:1px solid #c3a6df22; color:#e4d5f1; font-size:12px; cursor:pointer; }
.pet-settings-enable input { appearance:none; -webkit-appearance:none; width:33px; height:19px; border:1px solid #9c80b34d; border-radius:12px; background:#0c0816; margin:0; cursor:pointer; }
.pet-settings-enable input::before { content:""; display:block; width:13px; height:13px; margin:2px; border-radius:50%; background:#8e7e9f; transition:transform .18s,background .18s; }
.pet-settings-enable input:checked { background:#8052a6; border-color:#b384d9; }
.pet-settings-enable input:checked::before { transform:translateX(14px); background:#f4e8ff; }
.pet-setting-field { display:block; margin-top:12px; color:#d9c7e8; font-size:11px; }
.pet-setting-field>input,.pet-key-wrap { display:flex; align-items:center; width:100%; margin-top:6px; border:1px solid #b5a0c838; border-radius:9px; background:#09061173; }
.pet-setting-field input:not([type="checkbox"]) { min-width:0; width:100%; padding:10px 11px; color:#f2e8fc; font:12px/1.4 var(--sans,system-ui,sans-serif); user-select:text; -webkit-user-select:text; }
.pet-setting-field input::placeholder { color:#9d8eab; font-size:11px; }
.pet-key-wrap input { border:0; outline:none; background:transparent; border-radius:9px; }
.pet-key-wrap button { flex:none; padding:8px 10px; font-size:11px; color:#ba9bda; }
.pet-setting-field small { display:block; margin-top:5px; color:#a194b1; font-size:10px; line-height:1.5; }
.pet-models { margin-top:9px; padding:10px; border:1px solid #b5a0c829; border-radius:10px; background:#0d09173b; }
.pet-models-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pet-models-heading>span { display:flex; align-items:center; gap:6px; color:#bfaece; font-size:10px; }
.pet-models-heading b { display:inline-grid; place-items:center; min-width:19px; height:19px; padding:0 5px; border-radius:10px; background:#b5a0c81a; color:#dac7ee; font-size:10px; font-weight:400; }
.pet-models-heading button { display:flex; align-items:center; justify-content:center; gap:5px; padding:5px 7px; border:1px solid #b5a0c837; border-radius:7px; color:#d6bee9; font-size:10px; white-space:nowrap; }
.pet-models-heading button:hover { background:#b5a0c817; }
.pet-models-heading svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.pet-model-filter { width:100%; min-width:0; margin-top:9px; padding:7px 9px; border:1px solid #b5a0c833; border-radius:7px; background:#09061173; color:#ede0f8; font:11px/1.5 var(--sans,system-ui,sans-serif); user-select:text; -webkit-user-select:text; }
.pet-model-filter::placeholder { color:#9d8eab; }
.pet-model-list { display:flex; flex-wrap:wrap; gap:6px; max-height:132px; overflow:auto; overscroll-behavior:contain; margin-top:9px; scrollbar-width:thin; scrollbar-color:#6b527e transparent; }
.pet-model-list button { max-width:100%; padding:5px 8px; border:1px solid #b5a0c82e; border-radius:7px; background:#b5a0c80a; color:#ccb9df; font-size:10px; line-height:1.5; overflow-wrap:anywhere; text-align:left; }
.pet-model-list button:hover,.pet-model-list button[aria-pressed="true"] { border-color:#c29bdf99; background:#9670b73d; color:#f3e6ff; }
.pet-model-result { margin:7px 0 0; color:#a194b1; font-size:10px; line-height:1.6; overflow-wrap:anywhere; }
.pet-model-result[data-kind="success"] { color:#a2d7bc; }
.pet-model-result[data-kind="error"] { color:#f0aab1; }
.pet-model-empty { padding:4px; color:#a194b1; font-size:10px; }
.pet-settings-result { margin:12px 0 0; color:#b8a8cb; font-size:11px; white-space:pre-wrap; overflow-wrap:anywhere; }
.pet-settings-result:empty { display:none; }
.pet-settings-result[data-kind="success"] { color:#a2d7bc; }
.pet-settings-result[data-kind="error"] { color:#f0aab1; }
.pet-settings-footer { display:flex; gap:9px; margin-top:15px; }
.pet-settings-footer button { flex:1; min-height:37px; padding:8px 10px; border:1px solid #b798d340; border-radius:9px; font-size:12px; }
.pet-settings-footer button:last-child { background:linear-gradient(130deg,#8560a7,#69438e); border-color:#b88bd666; color:#fff3ff; }
.pet-settings button:disabled,.pet-settings input:disabled { opacity:.5; cursor:wait; }
.pet-settings-note { margin:10px 0 0; color:#a194b1; font-size:10px; text-align:center; line-height:1.6; }
.pet-restore { position:fixed; z-index:16; right:max(16px,env(safe-area-inset-right)); bottom:max(18px,env(safe-area-inset-bottom)); font-size:18px; }
.pet-restore[hidden] { display:none; }
@keyframes pet-appear { from { opacity:0; transform:translateY(6px) scale(.97); } to { opacity:1; transform:none; } }
@media(max-width:600px) {
  .web-pet { --pet-width:108px; --pet-height:137px; }
  .pet-actions { right:calc(100% - 7px); gap:6px; }
  .pet-actions button { width:31px; height:31px; padding:7px; }
  .pet-actions .pet-hide { width:24px; height:24px; }
  .pet-bubble { width:208px; padding:11px 13px; font-size:12px; }
  .pet-chat input { font-size:16px; }
  .pet-setting-field input:not([type="checkbox"]) { font-size:16px; }
  .pet-settings { padding:15px; }
  .pet-model-filter { font-size:16px; }
}
@media(max-height:560px) and (min-width:601px) { .web-pet { --pet-width:108px; --pet-height:137px; } }
@media(prefers-reduced-motion:reduce) { .web-pet *, .pet-restore { animation:none !important; transition:none !important; } }
