/* 挂在 #app 内时贴合手机屏幕；只有找不到 #app 才退回覆盖整个视口。 */
#tiny-home-motion { position:absolute; inset:0; z-index:2780; color:#54463e; background:#f7f2ea; font:15px/1.6 var(--app-font-family, sans-serif); overscroll-behavior:contain; overflow:hidden; }
body > #tiny-home-motion { position:fixed; }
body.hm-motion-open #love-mi-pet-stage { visibility:hidden; pointer-events:none; }
#tiny-home-motion * { box-sizing:border-box; }
#tiny-home-motion .hm-shell { height:100%; width:100%; display:flex; flex-direction:column; padding:var(--safe-area-inset-top,env(safe-area-inset-top,0px)) 0 var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)); }
#tiny-home-motion .hm-head { display:flex; gap:10px; align-items:center; padding:14px 14px 8px; border-bottom:1px solid #e8dfd2; }
#tiny-home-motion .hm-head div { flex:1; min-width:0; }
#tiny-home-motion .hm-head small { display:block; color:#998676; font-size:11px; letter-spacing:1px; }
#tiny-home-motion .hm-head strong { display:block; font-size:18px; }
#tiny-home-motion button { border:1px solid #d8c8b7; border-radius:12px; color:#69564a; background:#fffdf9; padding:9px 13px; min-height:42px; cursor:pointer; font:inherit; line-height:1.3; }
#tiny-home-motion button:disabled { opacity:.45; cursor:default; }
#tiny-home-motion button:hover:not(:disabled) { background:#ecdfce; }
#tiny-home-motion button:focus-visible, #tiny-home-motion input:focus-visible, #tiny-home-motion select:focus-visible, #tiny-home-motion textarea:focus-visible { outline:3px solid #608a7a; outline-offset:2px; }
#tiny-home-motion nav { display:flex; flex-wrap:wrap; gap:7px; padding:10px 14px 0; }
#tiny-home-motion nav [aria-current] { background:#657d6b; color:white; border-color:#657d6b; }
#tiny-home-motion nav [aria-current]:hover:not(:disabled) { background:#52715c; color:#fff; }
#tiny-home-motion nav .hm-lively { margin-left:auto; font-size:13px; padding:6px 11px; min-height:36px; border-radius:999px; color:#817363; }
#tiny-home-motion nav .hm-lively[aria-checked="true"] { color:#4d6552; border-color:#9fb59f; background:#eef3e9; }
#tiny-home-motion .hm-material-people { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#tiny-home-motion .hm-material-people label { min-width:0; }
#tiny-home-motion .hm-material-people select { min-width:0; text-overflow:ellipsis; }
#tiny-home-motion .hm-material-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; padding:16px 0; border-bottom:1px solid #d8c8b7; }
#tiny-home-motion .hm-material-row h4 { margin:0 0 4px; font-size:16px; overflow-wrap:anywhere; }
#tiny-home-motion .hm-material-row small { color:#817363; font-size:12px; }
#tiny-home-motion .hm-material-row button { max-width:144px; font-size:13px; }
#tiny-home-motion .hm-material-row .hm-note { margin:6px 0 0; overflow-wrap:anywhere; }
@media(max-width:380px) {
    #tiny-home-motion nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
    #tiny-home-motion nav > [data-hm^="tab:"] { min-width:0; padding:8px 5px; font-size:14px; white-space:nowrap; }
    #tiny-home-motion nav .hm-lively { grid-column:1 / -1; justify-self:end; }
    #tiny-home-motion .hm-material-row { gap:8px; }
    #tiny-home-motion .hm-material-row button { max-width:116px; padding:9px 8px; }
}
#tiny-home-motion main { flex:1; overflow:auto; padding:0 16px 28px; min-height:0; }
#tiny-home-motion .hm-status { margin:8px 16px; font-size:12px; color:#776a5d; overflow-wrap:anywhere; }
#tiny-home-motion .hm-busy { padding:10px 16px; background:#e7ede2; }
#tiny-home-motion .hm-busy small { display:block; }
#tiny-home-motion h3 { margin:16px 0 8px; font-size:20px; }
#tiny-home-motion p { margin:10px 0; }
#tiny-home-motion label { display:block; margin:12px 0; }
#tiny-home-motion textarea, #tiny-home-motion select, #tiny-home-motion input[type=number] { width:100%; font:inherit; color:inherit; padding:10px; border:1px solid #d6cbbb; border-radius:10px; background:#fffefa; }
#tiny-home-motion textarea { resize:vertical; }
#tiny-home-motion input[type=range] { width:100%; accent-color:#70896f; }
#tiny-home-motion .hm-actions { display:flex; gap:8px; flex-wrap:wrap; margin:14px 0; }
#tiny-home-motion .hm-motion-options { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:10px; margin:14px 0 4px; }
#tiny-home-motion .hm-motion-options label { margin:0; min-width:0; }
#tiny-home-motion .hm-motion-options label > span { display:block; margin-bottom:5px; font-size:13px; color:#6f5f52; }
#tiny-home-motion .hm-motion-options select { width:100%; min-width:0; height:44px; font-size:14px; padding:8px 4px; border-radius:8px; letter-spacing:0; }
#tiny-home-motion .hm-note { font-size:13px; color:#817363; }
#tiny-home-motion .hm-feedback { margin:18px 0 12px; padding:12px 0 12px 12px; border-left:3px solid #70896f; color:#4d6552; overflow-wrap:anywhere; scroll-margin:12px; }
#tiny-home-motion .hm-feedback--error { border-color:#b86a45; color:#8b452b; }
#tiny-home-motion .hm-feedback:focus { outline:2px solid #70896f; outline-offset:4px; }
#tiny-home-motion .hm-feedback strong { display:block; }
#tiny-home-motion .hm-feedback ul { margin:10px 0; padding-left:20px; }
#tiny-home-motion .hm-feedback li { margin:10px 0; }
#tiny-home-motion .hm-feedback li button { display:block; margin:6px 0; font-size:13px; }
#tiny-home-motion .hm-feedback small { display:block; margin-top:6px; color:#776a5d; }
#tiny-home-motion .hm-empty { text-align:center; max-width:560px; margin:35px auto; }
#tiny-home-motion .hm-empty .hm-actions { justify-content:center; }
#tiny-home-motion .hm-mark { font-size:78px; color:#8d9d84; }
#tiny-home-motion .hm-compare { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:20px; }
#tiny-home-motion input[type=file] { display:block; max-width:100%; margin-top:10px; font:inherit; }
#tiny-home-motion .hm-references { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#tiny-home-motion .hm-references img { height:130px; object-fit:contain; }
#tiny-home-motion .hm-references figcaption { overflow-wrap:anywhere; }
#tiny-home-motion figure { margin:0; min-width:0; }
#tiny-home-motion figure img { width:100%; max-height:410px; object-fit:contain; background:#e9e5de; border-radius:12px; }
#tiny-home-motion figcaption { font-size:12px; text-align:center; color:#857261; }
#tiny-home-motion .hm-details { border-top:1px solid #dacebd; padding:14px 0; margin-top:18px; }
#tiny-home-motion summary { cursor:pointer; font-weight:600; }
#tiny-home-motion .hm-check { display:flex; align-items:flex-start; gap:8px; }
#tiny-home-motion .hm-check input { margin-top:7px; width:18px; height:18px; flex:none; accent-color:#70896f; }
#tiny-home-motion .hm-geometry { display:block; width:100%; height:auto; border-radius:12px; margin:10px 0; touch-action:manipulation; }
#tiny-home-motion .hm-person { height:285px; display:flex; align-items:center; justify-content:center; margin:16px 0; border-radius:16px; background:repeating-conic-gradient(#ebe6dd 0% 25%,#f7f3ee 0% 50%) 0 / 24px 24px; }
#tiny-home-motion .hm-person canvas { max-width:100%; object-fit:contain; }
#tiny-home-motion .hm-action-group { margin:22px 0 4px; font-size:14px; color:#6f5f52; letter-spacing:.5px; }
#tiny-home-motion .hm-action-image { padding:14px 0 18px; border-top:1px solid #ddd3c6; scroll-margin:16px; }
#tiny-home-motion .hm-action-image--review .hm-action-photo { outline:3px solid #c98d7b; outline-offset:2px; }
#tiny-home-motion .hm-action-heading { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin-bottom:10px; }
#tiny-home-motion .hm-action-heading h4 { margin:0; font-size:16px; }
#tiny-home-motion .hm-action-heading span { font-size:12px; color:#915132; }
#tiny-home-motion .hm-action-heading .hm-action-legacy { color:#817363; padding:2px 8px; border:1px solid #d8c8b7; border-radius:999px; }
#tiny-home-motion .hm-action-heading .hm-action-ready { color:#4d6552; background:#e7ede2; padding:3px 9px; border-radius:999px; }
#tiny-home-motion .hm-action-options { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:10px; }
#tiny-home-motion .hm-action-options label { min-width:0; margin:4px 0 8px; font-size:13px; }
#tiny-home-motion .hm-action-options select { display:block; min-width:0; width:100%; margin-top:4px; padding:9px 5px; font-size:14px; }
#tiny-home-motion .hm-action-instructions { font-size:13px; }
#tiny-home-motion .hm-action-instructions textarea { display:block; margin-top:5px; min-width:0; font-size:14px; }
#tiny-home-motion .hm-action-buttons button { flex:1 1 125px; overflow-wrap:anywhere; }
#tiny-home-motion .hm-action-buttons button[data-hm^="save-action:"] { color:#fffdf9; background:#657d6b; border-color:#657d6b; }
#tiny-home-motion .hm-action-buttons button[data-hm^="save-action:"]:hover:not(:disabled) { background:#526954; }
#tiny-home-motion .hm-action-warning { color:#915132; overflow-wrap:anywhere; }
#tiny-home-motion .hm-action-directions { padding:5px 9px; border-radius:8px; background:#e7ede2; }
#tiny-home-motion .hm-legacy-photos { margin-top:14px; font-size:13px; }
#tiny-home-motion .hm-legacy-photos summary { margin-bottom:10px; font-weight:400; }
#tiny-home-motion .hm-appearance-active { padding:10px 12px; border-left:3px solid #70896f; background:#e7ede2; }
#tiny-home-motion .hm-style-warn { color:#8b452b; padding-left:10px; border-left:3px solid #c98d7b; }
#tiny-home-motion .hm-action-image:focus { outline:2px solid #70896f; outline-offset:4px; }
#tiny-home-motion .hm-action-photo { display:block; width:100%; border:0; padding:0; background:#e9e5de; border-radius:10px; overflow:hidden; margin-bottom:10px; }
#tiny-home-motion .hm-action-photo img { display:block; width:100%; height:auto; max-height:520px; object-fit:contain; }
#tiny-home-motion .hm-action-pending { color:#8a7b6b; padding:18px; background:#f0e9df; text-align:center; }
#tiny-home-motion .hm-image-viewer { position:absolute; inset:0; z-index:5; display:flex; flex-direction:column; padding:var(--safe-area-inset-top,env(safe-area-inset-top,0px)) 0 var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)); background:#f7f2ea; }
#tiny-home-motion .hm-image-viewer header { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:14px; border-bottom:1px solid #dacebd; }
#tiny-home-motion .hm-image-viewer header strong { flex:1; min-width:100px; }
#tiny-home-motion .hm-image-scroll { flex:1; min-height:0; overflow:auto; padding:12px; touch-action:pan-x pan-y; }
#tiny-home-motion .hm-image-scroll img { display:block; max-width:100%; max-height:100%; width:auto; height:auto; margin:auto; object-fit:contain; }
#tiny-home-motion .hm-image-viewer.is-original img { max-width:none; max-height:none; }
@media (max-width:430px) { #tiny-home-motion { font-size:14px; } #tiny-home-motion .hm-head { gap:6px; } #tiny-home-motion .hm-head strong { font-size:16px; } #tiny-home-motion .hm-head button { padding:8px; font-size:12px; } }
@media (prefers-reduced-motion:reduce) { #tiny-home-motion * { scroll-behavior:auto; } }
/* 房间页叠层：人物画在透明画布上，直接叠在原底图与家具之上。
   叠层本身不拦截手势（pointer-events:none），家具热点仍可点到；
   控制条单独恢复命中。层叠必须高于热点，否则床／沙发会盖住底部菜单。 */
.hm-room-layer { position:absolute; inset:0; z-index:100; pointer-events:none; color:#54463e; font:13px/1.5 var(--app-font-family, sans-serif); }
.hm-room-layer[hidden] { display:none; }
.hm-room-layer * { box-sizing:border-box; }
.hm-room-layer [data-hm-scene] { display:block; width:100%; height:100%; pointer-events:none; }
.hm-room-layer .hm-state { position:absolute; left:12px; top:12px; border-radius:20px; padding:4px 12px; font-size:12px; background:#fffaf0dd; pointer-events:none; }
.hm-room-layer .hm-state[hidden] { display:none; }
/* 操作菜单默认收起：左下角只有一枚 🐾；点开后展开成完整控制条。 */
.hm-room-bar { position:absolute; left:8px; right:8px; bottom:8px; z-index:1; padding:6px 8px; border-radius:14px; background:#fffaf0e6; box-shadow:0 4px 16px #51403022; pointer-events:auto; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.hm-room-bar:empty { display:none; }
.hm-room-bar.is-collapsed { right:auto; padding:0; border-radius:999px; background:transparent; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; }
.hm-paw { position:relative; width:44px; height:44px; padding:0; border:1px solid #d8c8b7; border-radius:999px; background:#fffaf0e6; box-shadow:0 4px 14px #51403026; font-size:22px; line-height:1; cursor:pointer; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); -webkit-tap-highlight-color:transparent; transition:transform .16s ease, background-color .16s ease; }
.hm-paw:hover { background:#f3e8da; }
.hm-paw:active { transform:scale(.94); }
.hm-paw:focus-visible { outline:3px solid #608a7a; outline-offset:2px; }
.hm-room-bar.is-open .hm-paw { width:34px; height:34px; font-size:17px; box-shadow:none; }
/* 收起时有需要处理的提示（缺形象、读取失败等）：右上角一个小红点 */
.hm-paw--note::after { content:''; position:absolute; top:3px; right:3px; width:9px; height:9px; border-radius:50%; background:#d3484c; box-shadow:0 0 0 2px #fffaf0; }
.hm-room-toast { position:absolute; left:8px; right:8px; bottom:60px; margin:0; padding:7px 12px; border-radius:12px; background:#3a2d25d9; color:#fffaf3; font-size:12px; line-height:1.4; pointer-events:none; overflow-wrap:anywhere; }
.hm-room-toast[hidden] { display:none; }
.hm-room-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
/* 第二行：双人动作（拥抱／并排坐／一起睡），只有两位有形象的人物同场时出现 */
.hm-room-row--pair { margin-top:6px; padding-top:6px; border-top:1px dashed #e3d8c9; }
.hm-room-tag { font-size:11px; color:#8a7b6b; padding:0 2px; letter-spacing:1px; }
.hm-room-bar button, .hm-room-bar select { border:1px solid #d8c8b7; border-radius:999px; color:#69564a; background:#fffdf9; padding:5px 10px; min-height:30px; font:inherit; font-size:12px; line-height:1.2; cursor:pointer; }
.hm-room-bar select { max-width:46vw; }
.hm-room-bar.is-open { width:max-content; max-width:calc(100% - 16px); right:auto; padding:7px; border:1px solid #e4d5c5; border-radius:18px; }
.hm-room-bar .hm-room-row { gap:5px; }
.hm-room-bar select[data-hm-field=controlKey] { max-width:110px; min-width:60px; text-overflow:ellipsis; }
.hm-room-bar .hm-auto-switch { display:inline-flex; align-items:center; gap:6px; border-color:transparent; background:#eee6da; padding:5px 8px; }
.hm-auto-switch i { display:inline-block; position:relative; width:29px; height:17px; border-radius:20px; background:#b7afa3; transition:background .16s; }
.hm-auto-switch i::after { content:''; position:absolute; width:13px; height:13px; left:2px; top:2px; border-radius:50%; background:#fffdf8; box-shadow:0 1px 3px #51403022; transition:transform .16s; }
.hm-auto-switch[aria-checked=true] i { background:#a78c68; }
.hm-auto-switch[aria-checked=true] i::after { transform:translateX(12px); }
.hm-room-hint { margin:5px 3px 0; font-size:10px; color:#9a8470; }
.hm-room-bar button:hover:not(:disabled) { background:#ecdfce; }
.hm-room-bar button:focus-visible, .hm-room-bar select:focus-visible, .hm-room-bar input:focus-visible { outline:3px solid #608a7a; outline-offset:2px; }
.hm-menu { position:relative; pointer-events:auto; }
.hm-menu-list { position:absolute; left:0; bottom:calc(100% + 6px); z-index:2; min-width:132px; padding:6px; border-radius:12px; background:#fffaf0f5; box-shadow:0 6px 18px #5140302a; display:flex; flex-direction:column; gap:4px; }
.hm-menu-list[hidden] { display:none; }
.hm-menu-list { max-height:min(260px,45dvh); overflow:auto; overscroll-behavior:contain; min-width:125px; }
.hm-menu[data-hm-menu*=pair] .hm-menu-list { left:auto; right:0; }
.hm-menu-list button { width:100%; border-radius:10px; text-align:left; white-space:nowrap; }
.hm-menu.is-open > [data-hm^="menu:"] { background:#ecdfce; }
.hm-room-note { margin:4px 2px 0; font-size:12px; color:#776a5d; overflow-wrap:anywhere; }
.hm-room-note:empty { display:none; }
@media (max-width:360px) { .hm-room-bar button,.hm-room-bar select { font-size:11px; padding:5px 8px; } .hm-room-bar select[data-hm-field=controlKey] { max-width:82px; } .hm-room-bar.is-open .hm-paw { width:30px; height:30px; } }
@media (prefers-reduced-motion:reduce) { .hm-auto-switch i,.hm-auto-switch i::after { transition:none; } }
.hm-room-note button { margin-left:4px; padding:2px 8px; min-height:24px; }
.hm-room-align { margin-top:6px; padding-top:6px; border-top:1px solid #e3d8c9; }
.hm-room-align label { display:block; margin:4px 0; font-size:12px; }
.hm-room-align input[type=range] { width:100%; accent-color:#70896f; }
.hm-room-align small { display:block; color:#8a7b6b; font-size:11px; }
/* 人物身上的控件只接管人物区域，空白房间仍可平移和点击家具。 */
.hm-actor-controls { position:absolute; inset:0; pointer-events:none; }
.hm-actor-hit, .hm-actor-handle, .hm-actor-editor { position:absolute; pointer-events:auto; box-sizing:border-box; }
.hm-actor-controls [hidden] { display:none !important; }
.hm-actor-hit { margin:0; padding:0; border:1px solid transparent; border-radius:12px; background:transparent; touch-action:none; cursor:grab; -webkit-tap-highlight-color:transparent; }
.hm-actor-hit.is-selected { border:1px dashed #70896f; background:#dce7d008; }
.hm-actor-hit:active { cursor:grabbing; }
.hm-actor-hit:focus-visible { outline:2px solid #70896f; outline-offset:2px; }
.hm-actor-handle { min-height:36px; padding:5px 9px; border:1px solid #d8c8b7; border-radius:999px; background:#fffaf0ee; color:#69564a; font:12px/1.4 var(--app-font-family,sans-serif); box-shadow:0 2px 8px #51403022; touch-action:manipulation; }
.hm-actor-editor { z-index:30; max-width:calc(100% - 12px); max-height:calc(100% - 12px); overflow:auto; padding:10px; border:1px solid #d8c8b7; border-radius:16px; background:#fffaf2f5; box-shadow:0 5px 20px #51403033; color:#69564a; font:12px/1.5 var(--app-font-family,sans-serif); }
.hm-actor-editor.is-dragging { visibility:hidden; }
.hm-actor-editor strong { display:block; margin-bottom:6px; font-size:13px; }
.hm-actor-editor button { min-height:36px; border:1px solid #d8c8b7; border-radius:12px; background:#fffdf9; color:inherit; font:inherit; padding:5px 9px; touch-action:manipulation; }
.hm-actor-editor button[aria-pressed=true] { background:#70896f; border-color:#70896f; color:#fffdf9; }
.hm-actor-editor p { margin:6px 0; font-size:11px; color:#887569; }
.hm-pose-angle, .hm-pose-row { display:flex; gap:6px; align-items:center; }
.hm-pose-angle input { flex:1; min-width:0; width:0; height:36px; accent-color:#70896f; touch-action:none; }
.hm-pose-row { margin-top:6px; justify-content:space-between; }
.hm-pose-number input { width:54px; min-height:32px; box-sizing:border-box; border:1px solid #d8c8b7; border-radius:8px; background:#fffdf9; color:inherit; text-align:center; }
.hm-actor-editor [data-pose-status] { display:block; margin-top:6px; font-size:11px; overflow-wrap:anywhere; }
/* 叠层已在热点之上且自身不拦截点击；热点保持默认层级即可点穿透明区域。 */
/* 动态全屏：顶栏悬浮在画面上方，状态标签与 🐾 提示避开顶栏和底部安全区。 */
.thr-panel.is-motion-fullscreen .hm-room-layer .hm-state { top:calc(66px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); }
.thr-panel.is-motion-fullscreen .hm-room-bar { bottom:calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
.thr-panel.is-motion-fullscreen .hm-room-toast { bottom:calc(62px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
/* 全屏操作卡只接管卡片本身；其他画面继续用于拖动、点击和双指缩放。 */
.hm-context-mode { --hm-card-surface:#fffcf6; --hm-card-text:#54463e; --hm-card-border:#e2d9cc; --hm-card-hover:#eee9df; --hm-card-accent:#496d5d; }
.thdr[data-phase="night"] .hm-context-mode,html[data-appearance="dark"] .hm-context-mode { --hm-card-surface:#252b36; --hm-card-text:#ece6d8; --hm-card-border:#444b55; --hm-card-hover:#363f49; --hm-card-accent:#b2d0bd; }
.hm-context-mode .hm-state { display:none; }
.hm-context-card { position:absolute; z-index:35; pointer-events:auto; box-sizing:border-box; display:flex; flex-direction:column; width:288px; max-width:calc(100% - 16px); overflow:hidden; overscroll-behavior:contain; border:1px solid var(--hm-card-border); border-radius:16px; padding:8px; background:var(--hm-card-surface); color:var(--hm-card-text); box-shadow:0 6px 18px #30241e26; -webkit-backdrop-filter:none; backdrop-filter:none; }
.hm-card-head { display:flex; flex:none; gap:8px; align-items:center; justify-content:space-between; padding-left:6px; }
.hm-card-head strong { min-width:0; overflow-wrap:anywhere; font-size:14px; }
.hm-context-card button,.hm-context-card select { min-height:44px; border:1px solid var(--hm-card-border); border-radius:10px; padding:8px 10px; color:inherit; background:var(--hm-card-surface); font:inherit; cursor:pointer; touch-action:manipulation; }
.hm-card-head button { flex:none; min-width:44px; border-color:transparent; padding:8px; font-size:12px; }
.hm-card-body { display:flex; flex-direction:column; min-height:0; gap:8px; overflow:auto; overscroll-behavior:contain; touch-action:pan-y; padding:2px 2px 4px; }
.hm-card-body:focus-visible { outline:2px solid var(--hm-card-accent); outline-offset:-2px; }
.hm-card-body > button,.hm-card-section button { text-align:left; }
.hm-context-card button:disabled { opacity:.5; cursor:default; }
.hm-context-card button:focus-visible,.hm-context-card select:focus-visible { outline:3px solid #608a7a; outline-offset:1px; }
.hm-card-state { margin:0 6px 2px; font-size:11px; opacity:.8; }
.hm-card-picker { margin:4px 6px; font-size:12px; }
.hm-card-picker select { display:block; width:100%; margin-top:4px; }
.hm-card-section { padding-top:10px; border-top:1px solid var(--hm-card-border); }
.hm-card-group-label { margin:0 6px 6px; font-size:11px; font-weight:600; }
.hm-action-grid { display:grid; grid-template-columns:repeat(var(--hm-action-columns,3),minmax(0,1fr)); gap:4px; }
.hm-action-single { grid-template-columns:repeat(var(--hm-single-columns,3),minmax(0,1fr)); }
.hm-context-card .hm-action-tile { display:flex; min-width:0; min-height:64px; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:6px 2px; border-color:transparent; background:transparent; text-align:center; transition:background-color .15s ease,transform .15s ease; }
.hm-action-icon { display:block; flex:none; width:32px; height:32px; background:currentColor; -webkit-mask-image:var(--hm-action-image); mask-image:var(--hm-action-image); -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }
.hm-action-label { display:block; font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
.hm-context-card .hm-action-tile[aria-pressed="true"] { color:var(--hm-card-accent); background:var(--hm-card-hover); }
.hm-context-card .hm-action-tile:active:not(:disabled) { transform:scale(.96); background:var(--hm-card-hover); }
.hm-card-note { margin:0 6px; font-size:11px; line-height:1.65; overflow-wrap:anywhere; opacity:.85; }
.hm-card-footer { display:flex; gap:6px; padding-top:8px; border-top:1px solid var(--hm-card-border); }
.hm-card-footer > button { border-color:transparent; }
.hm-context-card .hm-auto-switch { display:flex; flex:1; min-width:0; gap:8px; justify-content:space-between; align-items:center; font-size:12px; }
@media (hover:hover) { .hm-context-card button:hover:not(:disabled) { background:var(--hm-card-hover); } }
@media (prefers-reduced-motion:reduce) { .hm-context-card .hm-action-tile { transition:none; transform:none; } }
@media (forced-colors:active) { .hm-context-card .hm-action-tile { border-color:ButtonText; } .hm-action-icon { forced-color-adjust:none; background:ButtonText; } }
.hm-context-adjust { left:8px; right:auto; width:min(280px,calc(100% - 80px)); max-height:34dvh; overflow:auto; bottom:calc(10px + env(safe-area-inset-bottom, 0px)); background:var(--hm-card-surface); color:var(--hm-card-text); }
.hm-context-adjust .hm-room-align { margin:0; padding:0; border:0; }
.hm-context-adjust button { min-height:44px; }
.hm-person-state { position:absolute; z-index:2; transform:translateX(-50%); max-width:180px; padding:4px 10px; border-radius:14px; background:var(--hm-card-surface); color:var(--hm-card-text); font-size:12px; pointer-events:none; }
.hm-person-state[hidden] { display:none; }
.hm-walk-ripple { position:absolute; z-index:0; width:24px; height:14px; border:2px solid #82ab85; border-radius:50%; transform:translate(-50%,-50%); pointer-events:none; opacity:0; }
.hm-walk-ripple.is-visible { animation:hm-walk-ripple .65s ease-out; }
@keyframes hm-walk-ripple { from { opacity:.85; transform:translate(-50%,-50%) scale(.55); } to { opacity:0; transform:translate(-50%,-50%) scale(1.9); } }
@media (prefers-reduced-motion:reduce) { .hm-walk-ripple.is-visible { animation:none; opacity:.8; } }
@media (prefers-reduced-transparency:reduce) { .hm-context-card { -webkit-backdrop-filter:none; backdrop-filter:none; } }
/* 制作面板里的座位编辑区 */
#tiny-home-motion .hm-seats { margin:14px 0; padding:10px 12px; border:1px solid #e3d8c9; border-radius:12px; background:#fbf7f1; }
#tiny-home-motion .hm-seats h4 { margin:0 0 4px; font-size:14px; color:#6f5f52; }
#tiny-home-motion .hm-seats label { margin:8px 0; font-size:13px; }
#tiny-home-motion .hm-seats input[type=text] { width:100%; font:inherit; color:inherit; padding:9px 10px; border:1px solid #d6cbbb; border-radius:10px; background:#fffefa; }
#tiny-home-motion .hm-seats .hm-actions { margin:8px 0 0; }
#tiny-home-motion .hm-seats .hm-check { align-items:center; }
#tiny-home-motion .hm-seats .hm-check input { margin-top:0; }

/* 对齐开启时才显示人物命中区、调整按钮与编辑面板。 */
.hm-actor-controls[hidden] { display:none !important; }
.hm-actor-editor [data-pose-scale] { display:block; width:100%; accent-color:#70896f; }
#tiny-home-pair-panel { position:absolute; inset:0; z-index:2740; display:flex; flex-direction:column; overflow:hidden; padding:var(--safe-area-inset-top,0px) 0 var(--safe-area-inset-bottom,0px); background:#f7f2e9; color:#69564a; font:14px/1.5 var(--app-font-family,sans-serif); box-sizing:border-box; }
#tiny-home-pair-panel.hm-pair-fixed { position:fixed; }
#tiny-home-pair-panel * { box-sizing:border-box; }
#tiny-home-pair-panel [hidden] { display:none !important; }
#tiny-home-pair-panel header { display:flex; align-items:center; gap:12px; padding:12px; border-bottom:1px solid #e1d5c7; }
#tiny-home-pair-panel header strong, #tiny-home-pair-panel header small { display:block; }
#tiny-home-pair-panel button, #tiny-home-pair-panel select, #tiny-home-pair-panel textarea { color:inherit; font:inherit; border:1px solid #d8c8b7; border-radius:12px; background:#fffdf9; padding:8px 12px; min-height:42px; }
#tiny-home-pair-panel button { cursor:pointer; }
#tiny-home-pair-panel button:disabled { opacity:.5; cursor:default; }
#tiny-home-pair-panel main { flex:1; min-height:0; overflow:auto; padding:0 14px 20px; }
#tiny-home-pair-panel label { display:block; margin:12px 0; }
#tiny-home-pair-panel select, #tiny-home-pair-panel textarea { display:block; width:100%; margin-top:5px; }
#tiny-home-pair-panel .hm-pair-status { margin:0; padding:10px 14px; background:#ede8dc; overflow-wrap:anywhere; }
.hm-pair-references { display:flex; gap:10px; }
.hm-pair-references figure { flex:1; min-width:0; margin:0; text-align:center; }
.hm-pair-references img { width:100%; height:150px; object-fit:contain; border-radius:12px; background:repeating-conic-gradient(#ebe6dd 0% 25%,#f7f3ee 0% 50%) 0/20px 20px; }
.hm-pair-note { font-size:12px; color:#887569; }
.hm-pair-actions { display:flex; flex-wrap:wrap; gap:8px; }
#tiny-home-pair-panel .hm-pair-image { display:block; padding:0; width:100%; overflow:hidden; }
.hm-pair-image img { display:block; width:100%; max-height:440px; object-fit:contain; }
.hm-pair-preview { margin:14px 0; padding:12px; text-align:center; border-radius:14px; background:repeating-conic-gradient(#ebe6dd 0% 25%,#f7f3ee 0% 50%) 0/20px 20px; }
.hm-pair-preview canvas { max-width:100%; height:auto !important; }
#tiny-home-pair-panel .hm-pair-check { display:flex; align-items:flex-start; gap:8px; }
.hm-pair-viewer { position:absolute; inset:0; z-index:4; display:flex; flex-direction:column; gap:10px; padding:12px; background:#f7f2e9; }
.hm-pair-viewer>div { flex:1; min-height:0; overflow:auto; }
.hm-pair-viewer img { max-width:none; }

/* 透视调整：小屏滚动面板，触摸转视角和1像素位置微调。 */
.hm-actor-editor { overscroll-behavior:contain; touch-action:pan-y; }
.hm-pose-toolbar { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:6px; }
.hm-pose-orbit { min-height:48px; display:flex; align-items:center; justify-content:center; margin:6px 0; padding:4px; border:1px dashed #a8b79a; border-radius:12px; background:linear-gradient(135deg,#edf2e8,#f8f3eb); touch-action:none; cursor:move; user-select:none; }
.hm-pose-axis { display:flex; align-items:center; gap:4px; }
.hm-pose-axis input[type=range], .hm-pose-fit input[type=range] { width:100%; min-width:0; height:30px; accent-color:#70896f; touch-action:none; }
.hm-actor-editor input[type=number] { width:46px; min-height:30px; flex:0 0 46px; box-sizing:border-box; border:1px solid #d8c8b7; border-radius:8px; background:#fffdf9; color:inherit; text-align:center; }
.hm-pose-nudge { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-top:8px; }
.hm-pose-nudge button { flex:1; min-width:34px; padding:4px; }
.hm-pose-nudge select { max-width:60px; min-height:34px; border:1px solid #d8c8b7; border-radius:8px; color:inherit; background:#fffdf9; }
.hm-pose-fit { margin-top:8px; padding-top:6px; border-top:1px solid #e3d8c9; }
.hm-pose-fit summary { cursor:pointer; padding:4px 0; }
.hm-pose-fit label { display:block; margin:5px 0; }
.hm-actor-editor [data-pose-command=remake] { width:100%; margin-top:6px; }
/* Editing keeps the picture and the alignment close button exposed on narrow screens. */
.hm-room-layer.is-pose-editing .hm-room-bar > :not(:first-child),
.hm-room-layer.is-pose-editing .hm-room-bar > .hm-room-row:first-child > :not([data-hm=bar-toggle]):not([data-hm=align]) { display:none; }
.hm-room-layer.is-pose-editing .hm-room-bar > .hm-room-row:first-child { justify-content:space-between; }
.hm-actor-editor { display:flex; flex-direction:column; gap:6px; overflow:hidden; }
.hm-pose-head { flex:none; margin:-10px -10px 0; padding:8px 10px 1px; background:#fffaf2; border-bottom:1px solid #ede3d7; }
.hm-pose-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding-right:2px; touch-action:pan-y; }
/* Hide only the action UI's scrollbar; native wheel, touch and keyboard scrolling stay enabled. */
.hm-card-body,.hm-menu-list,.hm-context-adjust,.hm-pose-body { scrollbar-width:none; -ms-overflow-style:none; overscroll-behavior:contain; }
.hm-card-body::-webkit-scrollbar,.hm-menu-list::-webkit-scrollbar,.hm-context-adjust::-webkit-scrollbar,.hm-pose-body::-webkit-scrollbar { display:none; width:0; height:0; }
.hm-pose-head strong { overflow-wrap:anywhere; }
.hm-pose-field { display:flex; align-items:center; gap:6px; margin:3px 0; white-space:nowrap; }
.hm-pose-field > span { flex:1; min-width:0; }
.hm-pose-field .hm-pose-angle { gap:3px; }
.hm-pose-field .hm-pose-angle button { min-width:28px; padding:4px; }
.hm-pose-field input[type=number] { width:40px; flex-basis:40px; }
