.portfolio-ai-entry{position:fixed;right:22px;bottom:24px;z-index:84;display:flex;align-items:center;justify-content:center;gap:9px;height:43px;padding:0 15px;border:1px solid #83d9de;background:#122e43;color:#b8f0ef;box-shadow:3px 3px 0 #0b1723;border-radius:7px;font:700 12px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;cursor:pointer;touch-action:manipulation}.portfolio-ai-entry:hover{background:#1b485b;color:#fff}.portfolio-ai-entry__icon{display:grid;place-items:center;width:21px;height:21px;background:#263e47;color:#f2d877;font:20px/1 Georgia,serif;clip-path:polygon(3px 0,100% 0,100% calc(100% - 3px),calc(100% - 3px) 100%,0 100%,0 3px)}.portfolio-ai-entry:focus-visible,.portfolio-ai-dialog button:focus-visible,.portfolio-ai-dialog a:focus-visible{outline:3px solid #65d9e4;outline-offset:4px}.portfolio-ai-dialog{position:fixed;inset:18px 18px 18px auto;width:400px;height:calc(100svh - 36px);max-width:calc(100% - 36px);max-height:none;margin:0;padding:0;overflow:hidden;border:1px solid #91aab8;border-radius:13px;background:#f6f8fa;color:#173348;box-shadow:0 20px 80px #061b3960;font:14px/1.8 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif}.portfolio-ai-dialog::backdrop{background:#07152250;backdrop-filter:blur(2px)}.portfolio-ai-frame-holder{display:flex;flex-direction:column;height:100%;min-height:0}.portfolio-ai-frame-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;padding:3px 14px;border-bottom:1px solid #dce6ec;background:#f6f8fa;color:#6b8290;font-size:10px;flex-shrink:0}.portfolio-ai-frame-toolbar a{font-size:10px;color:#5d7e8d;text-decoration:none}.portfolio-ai-frame-toolbar button{font-family:inherit;font-weight:600;font-size:10px;line-height:1.8;color:#496d7c;background:transparent;border:0;padding:2px 0;cursor:pointer}.portfolio-ai-frame{width:100%;height:100%;min-height:0;flex:1;border:0;background:#f6f8fa;display:block}.portfolio-ai-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:19px;height:100%;padding:35px;text-align:center}.portfolio-ai-fallback__icon{font:44px/1 Georgia,serif;color:#bc9541}.portfolio-ai-fallback h2{font-size:23px;line-height:1.5;margin:0;color:inherit;font-family:inherit}.portfolio-ai-fallback p{font-size:13px;line-height:2;margin:0;color:#6e8494}.portfolio-ai-fallback button{background:#137d87;border:0;color:#fff;padding:10px 21px;border-radius:6px;cursor:pointer;font-family:inherit;font-weight:700;font-size:12px;line-height:1.6}.portfolio-ai-dialog [hidden],.portfolio-ai-entry[hidden]{display:none!important}html[data-phone-theme="dark"] .portfolio-ai-dialog{background:#101c2b;color:#e0eaf3;border-color:#355268}html[data-phone-theme="dark"] .portfolio-ai-frame-toolbar{background:#162637;color:#a4bacb;border-color:#2b4357}html[data-phone-theme="dark"] .portfolio-ai-frame-toolbar a,html[data-phone-theme="dark"] .portfolio-ai-frame-toolbar button{color:#a4c9d3}html[data-phone-theme="dark"] .portfolio-ai-fallback p{color:#9bb2c4}
@media(max-width:700px),(max-width:950px) and (orientation:landscape) and (max-height:520px){.portfolio-ai-entry{right:auto;left:15px;bottom:calc(76px + env(safe-area-inset-bottom));height:39px;padding:0 12px;border-radius:9px;font-size:11px;gap:7px;box-shadow:0 3px 13px #0b172325}.portfolio-ai-entry__icon{width:19px;height:19px;font-size:18px}.portfolio-ai-dialog{inset:0;width:100%;height:100svh;max-width:100%;border:0;border-radius:0}.portfolio-ai-frame-toolbar{min-height:30px;padding-left:max(15px,env(safe-area-inset-left));padding-right:max(15px,env(safe-area-inset-right));padding-top:max(3px,env(safe-area-inset-top));font-size:10px}.portfolio-ai-fallback{padding:35px 27px}.portfolio-ai-fallback h2{font-size:24px}}
@media(prefers-reduced-motion:reduce){.portfolio-ai-entry,.portfolio-ai-dialog{scroll-behavior:auto;transition:none}}
.portfolio-ai-entry{background:#fbf8ef;border-color:#c5b9a9;color:#8d402d;box-shadow:3px 3px 0 #252b242b}.portfolio-ai-entry:hover{background:#fff0e5;color:#a53f28}.portfolio-ai-entry__icon{background:#f3e6d8;color:#c95336}.portfolio-ai-dialog{width:460px;border-color:#d4d4c8;background:#fbfaf7;color:#292e29}.portfolio-ai-frame-toolbar{background:#f5f2eb;color:#73786b;border-color:#e4e1d8}.portfolio-ai-frame-toolbar a,.portfolio-ai-frame-toolbar button{color:#61695d}.portfolio-ai-frame{background:#fbfaf7}html[data-phone-theme="dark"] .portfolio-ai-dialog{background:#202925;border-color:#4a584e;color:#e3e8df}html[data-phone-theme="dark"] .portfolio-ai-frame-toolbar{background:#253029;border-color:#3b483e}html[data-phone-theme="dark"] .portfolio-ai-frame-toolbar a,html[data-phone-theme="dark"] .portfolio-ai-frame-toolbar button{color:#c3d0c0}@media(max-width:700px),(max-width:950px) and (orientation:landscape) and (max-height:520px){.portfolio-ai-dialog{width:100%}}
/* A draggable paper-star companion. Its position never changes document layout. */
.portfolio-ai-entry.guide-companion{width:152px;height:62px;padding:9px 11px;gap:10px;border:1px solid #d8a771;border-radius:22px 22px 22px 8px;background:linear-gradient(135deg,#fff5d9,#f7dfbb);color:#783e2a;box-shadow:0 9px 26px #70432622,0 0 0 4px #fff9ef80;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;isolation:isolate;transition:box-shadow .2s,border-radius .2s,width .2s;}
.portfolio-ai-entry.guide-companion:hover{background:linear-gradient(135deg,#fff8e8,#f5d6aa);box-shadow:0 11px 28px #70432635,0 0 0 4px #f6e5d7aa;}
.guide-companion .guide-companion__star{flex:none;width:35px;height:35px;border-radius:12px;clip-path:none;background:#bc6747;color:#fff1c8;font:29px/1 Georgia,serif;box-shadow:inset 0 0 0 1px #ffffff44;animation:guide-star-hello 4s ease-in-out 3;}
.guide-companion__label{display:flex;flex-direction:column;gap:3px;white-space:nowrap;text-align:left;font:650 13px/1.25 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;}
.guide-companion__label small{font:500 9px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;color:#956a4e;letter-spacing:.03em;}
.guide-companion__grip{position:absolute;right:5px;top:8px;color:#a67b55;font-size:12px;opacity:.6;}
.portfolio-ai-entry.guide-companion.is-dragging{cursor:grabbing;transition:none;box-shadow:0 16px 34px #5d352c40,0 0 0 5px #f3dbb999;z-index:90;}
.portfolio-ai-entry.guide-companion.is-docked{width:56px;height:56px;padding:8px;border-radius:50%;background:var(--book-surface,#fff9ef);border:2px solid var(--book-accent,#a74f33);box-shadow:0 4px 16px #70432624,0 0 0 5px var(--book-paper,#fff9ef);}
.guide-companion.is-docked .guide-companion__label,.guide-companion.is-docked .guide-companion__grip{display:none;}
.guide-companion.is-docked .guide-companion__star{border-radius:50%;width:35px;height:35px;}
.is-guide-near{outline:2px dashed var(--book-accent,#a74f33)!important;outline-offset:5px;}
.is-guide-dock{box-shadow:0 0 0 1px var(--book-accent,#a74f33),0 7px 25px #70432612!important;}
.guide-companion-hint{position:fixed;z-index:86;display:flex;align-items:flex-start;gap:8px;width:230px;max-width:calc(100vw - 24px);padding:13px 12px 13px 15px;border:1px solid var(--book-line,#e4d7c4);border-radius:15px 15px 5px 15px;background:var(--book-surface,#fffcf6);color:var(--book-ink,#42362e);box-shadow:0 8px 30px #50391e1c;font:500 12px/1.75 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;}
.guide-companion-hint p{margin:0;flex:1;}
.guide-companion-hint button{width:25px;height:25px;flex:none;border:0;border-radius:50%;background:var(--book-tint,#f5ead9);color:var(--book-muted,#776857);font:18px/1 sans-serif;cursor:pointer;}
.guide-companion-hint[hidden]{display:none!important;}
html[data-phone-theme="dark"] .portfolio-ai-entry.guide-companion{background:linear-gradient(135deg,#694b35,#4f3b2b);color:#ffdfaf;border-color:#a98154;box-shadow:0 9px 26px #0004,0 0 0 4px #29271f90;}
html[data-phone-theme="dark"] .guide-companion__label small{color:#dfbd95;}
html[data-phone-theme="dark"] .guide-companion.is-docked{background:var(--book-surface);}
@keyframes guide-star-hello{0%,65%,100%{transform:rotate(-6deg)}76%{transform:rotate(12deg)}88%{transform:rotate(-12deg)}}
@media(max-width:700px),(max-width:950px) and (orientation:landscape) and (max-height:520px){.portfolio-ai-entry.guide-companion{right:auto;left:16px;bottom:calc(86px + env(safe-area-inset-bottom));width:142px;height:56px;padding:8px 10px;border-radius:19px 19px 19px 7px;gap:8px;}.guide-companion__label{font-size:12px;}.guide-companion__label small{font-size:9px;}.guide-companion-hint{width:212px;font-size:12px;}.portfolio-ai-entry.guide-companion.is-docked{width:54px;height:54px;border-radius:50%;}}
@media(prefers-reduced-motion:reduce){.portfolio-ai-entry.guide-companion,.guide-companion__star{animation:none!important;transition:none!important;}}
html[data-reduce-motion="1"] .guide-companion__star{animation:none!important;}
.guide-companion .guide-companion__star{width:40px;height:40px;background:transparent;box-shadow:none;border-radius:0;}
.guide-companion__star svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 2px 0 #a7694020);image-rendering:pixelated;}
.guide-companion.is-docked .guide-companion__star{width:38px;height:38px;background:none;border-radius:0;}

/* Voxel Earth companion: transparent footprint, independent of page layout. */
.portfolio-ai-entry.guide-companion.guide-earth,
.portfolio-ai-entry.guide-companion.guide-earth.is-docked{width:88px;height:104px;display:flex;flex-direction:column;justify-content:flex-start;gap:0;padding:0;border:0;border-radius:18px;background:transparent;box-shadow:none;color:var(--book-ink,#493e32);overflow:visible;transition:none;}
.portfolio-ai-entry.guide-companion.guide-earth:hover,
html[data-phone-theme="dark"] .portfolio-ai-entry.guide-companion.guide-earth{background:transparent;box-shadow:none;}
.guide-companion.guide-earth .guide-companion__star,
.guide-companion.guide-earth.is-docked .guide-companion__star{width:88px;height:88px;display:block;clip-path:none;border:0;background:none;box-shadow:none;animation:none!important;}
.guide-earth-globe{display:block;width:100%;height:100%;image-rendering:pixelated;filter:drop-shadow(0 2px 1px #193c4020);}
.guide-earth .guide-companion__label,
.guide-earth.is-docked .guide-companion__label{display:block;text-align:center;background:var(--book-surface,#fffcf6);border:1px solid var(--book-line,#dfcdb3);border-radius:20px;padding:4px 10px;font-size:11px;line-height:1.3;letter-spacing:.02em;box-shadow:0 3px 10px #49321912;transform:translateY(-5px);}
.guide-earth .guide-companion__label small,.guide-earth .guide-companion__grip{display:none;}
.guide-earth.is-earth-held .guide-companion__label{opacity:.45;}
.guide-earth-particles{position:fixed;inset:0;width:100vw;height:100vh;z-index:85;pointer-events:none;contain:strict;}
#guide-drag-help,.guide-companion-live{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;}
@media(max-width:700px),(max-width:950px) and (orientation:landscape) and (max-height:520px){.portfolio-ai-entry.guide-companion.guide-earth,.portfolio-ai-entry.guide-companion.guide-earth.is-docked{width:76px;height:92px;left:12px;bottom:calc(82px + env(safe-area-inset-bottom));}.guide-companion.guide-earth .guide-companion__star,.guide-companion.guide-earth.is-docked .guide-companion__star{width:76px;height:76px;}.guide-earth .guide-companion__label{font-size:10px;}}

@media(min-width:701px){body:has(.guide-earth) .to-top{bottom:146px;}}

/* One compositor owns both the model and its particles; keep its model buffer invisible. */
.guide-book .guide-earth-globe{opacity:0;}
