/* =====================================================================
 * 「小小宅居」样式（tiny-home.css）
 * ---------------------------------------------------------------------
 * 结构/逻辑见 tiny-home.js（主界面/向导/公寓详情/仓库）与
 * tiny-home-decor.js（房间装修层）。
 * 层级：主界面 .th-root 2706（同族 csa 2705 之上一档）；
 *   房间装修层 .thr-root 2708；装修仓库 .th-warehouse-host 2712；
 *   通用确认弹窗 .th-confirm-host 2714 —— 保证 仓库/确认 能盖住房间层。
 * 配色：奶油暖色族（--th-cream #f7efe6 / --th-clay #c98d7b / --th-ink #5c4a40），
 *   与「宅居」的温馨定位一致，区别于行程的冰蓝色族。
 * 命名：主界面 th- 前缀、房间层 thr- 前缀，独立文件，不与其它模块共用。
 * ===================================================================== */

/* ============================ 全屏层 ============================ */

.th-root,
.thr-root {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    display: none;
    background:
        radial-gradient(circle at 16% 10%, rgba(201, 141, 123, 0.22), transparent 44%),
        radial-gradient(circle at 86% 18%, rgba(232, 196, 160, 0.26), transparent 42%),
        linear-gradient(180deg, #faf5ee 0%, #f1e6d8 100%);
}

.th-root { z-index: 2706; }
.thr-root { z-index: 2708; }

.th-root.is-open,
.thr-root.is-open {
    display: flex;
    flex-direction: column;
}

.th-panel,
.thr-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ============================ 顶栏 ============================ */

.th-head {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 9px 12px;
    padding-top: max(9px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    display: grid;
    grid-template-columns: 42px 1fr 58px;
    align-items: center;
    gap: 8px;
    background: rgba(250, 245, 238, 0.9);
    border-bottom: 1px solid rgba(201, 141, 123, 0.32);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.th-head h2 {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    color: #5c4a40;
    letter-spacing: 1px;
}

.th-back {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #5c4a40;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 18px rgba(92, 74, 64, 0.1);
    cursor: pointer;
    font-weight: 900;
    font-size: 30px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.th-back:active { transform: scale(0.95); }

.th-head-tool {
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(201, 141, 123, 0.4);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.72);
    color: #8a6355;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-head-tool:active { transform: scale(0.95); }

.th-head-tool--primary {
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(192, 123, 102, 0.34);
}

/* ============================ 顶栏下拉菜单（主界面「设置」 / 公寓详情「菜单」） ============================ */

.th-head-menu-layer {
    position: absolute;
    inset: 0;
    z-index: 36;
    background: rgba(60, 44, 36, 0.14);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.th-head-menu-layer.is-open { opacity: 1; }

.th-head-menu {
    position: absolute;
    top: calc(56px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    right: 12px;
    width: min(288px, calc(100% - 24px));
    padding: 8px;
    border-radius: 18px;
    background: #fdf9f3;
    box-shadow: 0 18px 44px rgba(60, 44, 36, 0.3);
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: transform 0.18s ease;
}

.th-head-menu-layer.is-open .th-head-menu { transform: none; }

.th-head-menu__title {
    padding: 6px 10px 8px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: rgba(92, 74, 64, 0.55);
}

.th-head-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 10px 10px 12px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #5c4a40;
    text-align: left;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-head-menu__item + .th-head-menu__item { margin-top: 2px; }
.th-head-menu__item:hover { background: rgba(201, 141, 123, 0.12); }
.th-head-menu__item:active { background: rgba(201, 141, 123, 0.2); }

.th-head-menu__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.th-head-menu__text b { font-size: 14px; font-weight: 800; }

.th-head-menu__text small {
    font-size: 11px;
    line-height: 1.45;
    color: rgba(92, 74, 64, 0.58);
}

.th-head-menu__chev { color: rgba(92, 74, 64, 0.35); font-size: 18px; }

.th-head-menu__item--warn b { color: #a3672a; }

@media (prefers-reduced-motion: reduce) {
    .th-head-menu-layer,
    .th-head-menu { transition: none; }
}

html[data-appearance="dark"] .th-head-menu { background: #2f2721; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); }
html[data-appearance="dark"] .th-head-menu__item { color: #f0e4da; }
html[data-appearance="dark"] .th-head-menu__title,
html[data-appearance="dark"] .th-head-menu__text small { color: rgba(240, 228, 218, 0.6); }
html[data-appearance="dark"] .th-head-menu__item:hover { background: rgba(255, 255, 255, 0.06); }

/* ============================ 内容区 ============================ */

.th-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 14px;
    padding-bottom: max(24px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.th-body::-webkit-scrollbar { display: none; width: 0; height: 0; }

.th-empty {
    margin: 14px 4px;
    padding: 22px 16px;
    border-radius: 16px;
    border: 1px dashed rgba(201, 141, 123, 0.5);
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(92, 74, 64, 0.68);
}

.th-hint {
    margin: 10px 4px 14px;
    text-align: center;
    font-size: 12px;
    color: rgba(92, 74, 64, 0.55);
}

/* 人设卡已不在「我的人设」中（孤儿住户）：找回 / 重新认证户主 */
.th-orphan-notice {
    margin: 12px 4px 4px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    border: 1px dashed rgba(201, 141, 123, 0.6);
    background: rgba(255, 244, 240, 0.85);
    font-size: 12.5px;
    line-height: 1.65;
    color: rgba(92, 74, 64, 0.82);
}
.th-orphan-notice strong { display: block; font-size: 13.5px; color: #8a4a3c; margin-bottom: 4px; }
.th-orphan-notice p { margin: 0 0 10px; }
.th-orphan-notice__btns { display: flex; gap: 8px; }
.th-orphan-notice__btns .th-btn { flex: 1 1 0; }
.th-badge--action {
    cursor: pointer;
    border: 0;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.th-persona-pick { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; -webkit-overflow-scrolling: touch; margin-top: 8px; }
.th-persona-pick__row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 14px;
    border: 1px solid rgba(201, 141, 123, 0.35);
    background: rgba(255, 255, 255, 0.7);
    text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.th-persona-pick__row.is-selected { border-color: #b96e5a; box-shadow: 0 0 0 2px rgba(185, 110, 90, 0.25); }
.th-persona-pick__avatar {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    background: rgba(201, 141, 123, 0.18) center/cover no-repeat;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px; overflow: hidden;
}
.th-persona-pick__avatar img { width: 100%; height: 100%; object-fit: cover; }
.th-persona-pick__name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; word-break: break-all; }
.th-persona-pick__tag { flex: 0 0 auto; font-size: 10px; padding: 3px 7px; border-radius: 999px; background: rgba(185, 110, 90, 0.16); color: #8a4a3c; }
html[data-appearance="dark"] .th-orphan-notice { background: rgba(70, 48, 44, 0.55); color: rgba(255, 235, 228, 0.85); }
html[data-appearance="dark"] .th-orphan-notice strong { color: #f1b6a6; }
html[data-appearance="dark"] .th-persona-pick__row { background: rgba(60, 46, 44, 0.7); }

/* ============================ 住户选择条 ============================ */

.th-resident-group { margin-bottom: 4px; }

.th-resident-group__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 2px 4px 7px;
}

.th-resident-group__head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #6b5348;
    letter-spacing: 0.5px;
}

.th-resident-group__head small {
    font-size: 10.5px;
    color: rgba(92, 74, 64, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-resident-empty {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px dashed rgba(176, 154, 142, 0.45);
    font-size: 11.5px;
    color: rgba(92, 74, 64, 0.55);
}

.th-resident-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* 触屏横滑交给浏览器（pan-x），桌面端由 JS 补按住拖动/滚轮横滚 */
    touch-action: pan-x;
    cursor: grab;
}

.th-resident-strip:active { cursor: grabbing; }

.th-resident-strip::-webkit-scrollbar { display: none; }

.th-resident {
    flex: 0 0 auto;
    width: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 4px 8px;
    border: 1.5px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.th-resident.is-selected {
    border-color: rgba(192, 123, 102, 0.75);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 22px rgba(192, 123, 102, 0.2);
}

.th-resident__avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #d8a08c 0%, #a8705d 100%);
}

.th-resident__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.th-resident__name {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 700;
    color: #5c4a40;
}

.th-resident__tag {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #e0a5c0, #c47a9d);
    border-radius: 7px;
    padding: 1px 5px;
}

/* ============================ 区块标题 / 徽标 ============================ */

.th-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 4px 4px 10px;
}

.th-section-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #5c4a40;
}

.th-section-sub {
    font-size: 12px;
    color: rgba(92, 74, 64, 0.55);
}

.th-badge {
    display: inline-block;
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    color: #8a6355;
    background: rgba(201, 141, 123, 0.16);
    border: 1px solid rgba(201, 141, 123, 0.34);
    border-radius: 8px;
    padding: 1px 7px;
}

.th-badge--love {
    color: #b05a80;
    background: rgba(224, 165, 192, 0.2);
    border-color: rgba(224, 165, 192, 0.5);
}

.th-badge--warn {
    color: #a3672a;
    background: rgba(224, 172, 92, 0.18);
    border-color: rgba(224, 172, 92, 0.44);
}

/* 未读计数角标（留言板等）：红点风格，与信息类徽标区分开 */
.th-badge--dot {
    color: #fff;
    background: #e2564e;
    border-color: rgba(226, 86, 78, 0.9);
    min-width: 16px;
    padding: 1px 5px;
    text-align: center;
}

/* ============================ 公寓卡片 ============================ */

.th-home-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.th-home-card {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 28px rgba(139, 109, 92, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.th-home-card:active { transform: scale(0.985); }

.th-home-card__plan {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    overflow: hidden;
    background: #fbf7f2;
    box-shadow: 0 4px 10px rgba(139, 109, 92, 0.16);
}

.th-home-card__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.th-home-card__main strong {
    font-size: 14.5px;
    font-weight: 700;
    color: #4a3a32;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-home-card__main small {
    font-size: 11.5px;
    color: rgba(92, 74, 64, 0.6);
}

.th-home-card__main .th-badge { align-self: flex-start; margin-top: 2px; }

.th-home-card__chevron {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 700;
    color: rgba(92, 74, 64, 0.38);
}

/* ============================ 按钮 ============================ */

.th-btn {
    box-sizing: border-box;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid rgba(201, 141, 123, 0.4);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.78);
    color: #6d564a;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-btn:active { transform: scale(0.97); }
.th-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.th-btn--primary {
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px rgba(192, 123, 102, 0.32);
}

.th-btn--danger {
    background: linear-gradient(135deg, #d9756a 0%, #bf5346 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px rgba(191, 83, 70, 0.3);
}

.th-btn--danger-ghost {
    border-color: rgba(191, 83, 70, 0.42);
    background: rgba(255, 255, 255, 0.6);
    color: #b0574b;
}

.th-btn--block {
    display: block;
    width: 100%;
    margin: 8px 0;
}

.th-btn--mini {
    min-height: 32px;
    padding: 5px 11px;
    font-size: 12px;
    border-radius: 10px;
    flex: 0 0 auto;
}

.th-btn.is-active {
    border-color: rgba(192, 123, 102, 0.8);
    background: rgba(216, 154, 134, 0.15);
}

/* ============================ 弹窗骨架 ============================ */

.th-modal-mask {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 14px;
    background: rgba(60, 44, 36, 0.42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.th-modal {
    box-sizing: border-box;
    width: 100%;
    max-width: 340px;
    max-height: 86%;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: #fdf9f3;
    box-shadow: 0 24px 56px rgba(60, 44, 36, 0.35);
    overflow: hidden;
}

.th-modal--tall { height: 86%; }

.th-modal__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px 10px;
    border-bottom: 1px solid rgba(201, 141, 123, 0.24);
}

.th-modal__head h3 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 800;
    color: #5c4a40;
}

.th-modal__head h3 small {
    font-size: 12px;
    font-weight: 600;
    color: rgba(92, 74, 64, 0.55);
    margin-left: 4px;
}

.th-modal__close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    background: rgba(201, 141, 123, 0.14);
    color: #8a6355;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px 18px;
    scrollbar-width: none;
}

.th-modal__body::-webkit-scrollbar { display: none; }

/* 底图生成等「输入+操作」贴在卡片底部：键盘升起后卡片贴底，输入框始终露在键盘上方 */
.th-modal__foot {
    flex: 0 0 auto;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(201, 141, 123, 0.16);
}

.th-modal__foot .th-wiz-tip { margin-top: 12px; }
.th-modal__foot .th-wiz-btns { margin-bottom: 0; }

/* ------------------------------------------------------------------ */
/* 软键盘避让（红米 K90 / 小米 HyperOS / 华为鸿蒙 / iPhone Safari 等）  */
/* overlay-keyboard-compat-guard 在键盘期给当前遮罩打 active，并写入     */
/* --lovemi-overlay-kb-inset。居中卡片改为贴在剩余可视区底部，输入框     */
/* 与生成按钮不再被系统输入法盖住。resize 模式（APK adjustResize）inset */
/* ≈0，本规则不生效，避免双重抬升把房间底图顶出屏幕。                   */
/* ------------------------------------------------------------------ */
.th-modal-mask.lovemi-overlay-kb-active,
.thr-msgmenu-mask.lovemi-overlay-kb-active {
    bottom: var(--lovemi-overlay-kb-inset, 0px);
    align-items: flex-end;
    justify-content: center;
    padding-bottom: max(8px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    overflow: hidden;
    box-sizing: border-box;
}

.th-modal-mask.lovemi-overlay-kb-active .th-modal,
.thr-msgmenu-mask.lovemi-overlay-kb-active .thr-msgedit {
    max-height: 100%;
    min-height: 0;
}

.th-confirm-host.lovemi-overlay-kb-active {
    align-items: flex-end;
    padding-bottom: max(12px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    box-sizing: border-box;
}

.thr-ai-panel.lovemi-overlay-kb-active {
    bottom: max(8px, var(--lovemi-overlay-kb-inset, 0px)) !important;
    top: auto !important;
    max-height: calc(100% - var(--lovemi-overlay-kb-inset, 0px) - 16px);
}

body[data-lovemi-overlay-kb="1"] .th-input:focus,
body[data-lovemi-overlay-kb="1"] .th-textarea:focus,
body[data-lovemi-overlay-kb="1"] .th-select:focus,
body[data-lovemi-overlay-kb="1"] .thr-msgedit__text:focus,
body[data-lovemi-overlay-kb="1"] #tiny-home-motion textarea:focus,
body[data-lovemi-overlay-kb="1"] #tiny-home-motion input:focus {
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
    caret-color: auto !important;
    scroll-margin-bottom: calc(12px + var(--lovemi-overlay-kb-inset, 0px));
}

/* APK resize 模式：WebView 已被压到键盘上方，只需保证卡片不超出当前壳 */
body[data-mobile-keyboard-open="1"] .th-modal-mask {
    overflow: hidden;
}
body[data-mobile-keyboard-open="1"] .th-modal-mask .th-modal {
    max-height: min(86%, 100%);
}
body[data-mobile-keyboard-open="1"] .th-modal__body {
    scroll-padding-bottom: 80px;
}

/* 聚焦前即保持字号，避免 iOS 先自动缩放、键盘标记到达后又改变布局。
   覆盖新工作室、访客频率、双人素材和画布内人物数值编辑。 */
@media (pointer: coarse) {
    :is(.th-root, .thr-root, .thrs, .th-confirm-host, .th-warehouse-host,
        .th-guest-host, .th-stash-host, #tiny-home-motion, #tiny-home-pair-panel)
        :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), textarea, select) {
        font-size: 16px !important;
    }
}

/* ============================ 向导 ============================ */

.th-wiz-tip {
    margin: 2px 0 10px;
    font-size: 13px;
    line-height: 1.65;
    color: #6d564a;
}

.th-wiz-note {
    margin: 8px 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: rgba(92, 74, 64, 0.55);
}

.th-wiz-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

/* 房间画风选择（底图弹窗）：真实风 / 3D 卡通 / 2D 插画 */
.thr-art-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.thr-art-chip {
    border: 1px solid rgba(201, 141, 123, 0.5);
    border-radius: 999px;
    padding: 7px 14px;
    background: #fffaf4;
    color: #6d564a;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.thr-art-chip.is-active {
    background: #c98d7b;
    border-color: #c98d7b;
    color: #fff;
    font-weight: 700;
}

.thr-art-chip:focus-visible {
    outline: 3px solid rgba(192, 123, 102, 0.6);
    outline-offset: 2px;
}

.thr-art-hint {
    font-size: 12px;
    color: #8a7364;
}

.th-wiz-btns--stack {
    flex-direction: column;
    gap: 8px;
}

.th-wiz-match {
    margin: 8px 0 2px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #7c5d92;
    background: rgba(200, 176, 224, 0.18);
    border: 1px solid rgba(200, 176, 224, 0.44);
}

.th-wiz-match--warn {
    color: #a3672a;
    background: rgba(224, 172, 92, 0.14);
    border-color: rgba(224, 172, 92, 0.4);
}

.th-map-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.th-map-option {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border: 1.5px solid rgba(201, 141, 123, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.th-map-option__name {
    font-size: 14px;
    font-weight: 700;
    color: #4a3a32;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-map-option.is-selected {
    border-color: rgba(192, 123, 102, 0.85);
    background: rgba(216, 154, 134, 0.16);
    box-shadow: 0 8px 18px rgba(192, 123, 102, 0.18);
}

.th-map-option.is-blocked {
    opacity: 0.55;
    cursor: not-allowed;
}

.th-input,
.th-textarea,
.th-select {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 13px;
    margin: 4px 0;
    border: 1.5px solid rgba(201, 141, 123, 0.36);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.85);
    color: #4a3a32;
    font-size: 14px;
    outline: none;
}

.th-input:focus,
.th-textarea:focus,
.th-select:focus {
    border-color: rgba(192, 123, 102, 0.85);
    box-shadow: 0 0 0 3px rgba(216, 154, 134, 0.18);
}

.th-textarea {
    resize: vertical;
    min-height: 84px;
    line-height: 1.6;
}

/* 新居入住 · 落户楼栋下拉：自绘列表，宽度与输入框一致、高度由 JS 收紧在弹窗内 */
.th-combo { position: relative; }

.th-combo__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.th-combo__btn:disabled { cursor: default; opacity: 0.7; }
.th-combo__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-combo__caret { flex: none; display: flex; color: #a07d6c; transition: transform 0.15s ease; }
.th-combo__btn[aria-expanded="true"] .th-combo__caret { transform: rotate(180deg); }

/* 列表随文档流展开（把地址框往下推、弹窗随之长高），不浮层遮挡；
   弹窗本身有 max-height，列表再限高并内部滚动，所以永远不会超出弹窗 */
.th-combo__list {
    box-sizing: border-box;
    margin: 2px 0 6px;
    max-height: min(240px, 38vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
    border: 1.5px solid rgba(201, 141, 123, 0.36);
    border-radius: 13px;
    background: #fffaf4;
}

.th-combo__list[hidden] { display: none; }

.th-combo__group {
    padding: 8px 10px 4px;
    font-size: 12px;
    font-weight: 700;
    color: #a07d6c;
}

.th-combo__opt {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #4a3a32;
    font: inherit;
    font-size: 14px;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.th-combo__opt--home { padding-left: 18px; }
.th-combo__opt:hover,
.th-combo__opt:focus-visible { background: rgba(216, 154, 134, 0.14); outline: none; }
.th-combo__opt[aria-selected="true"] { background: rgba(201, 141, 123, 0.22); font-weight: 700; }

.th-template-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 9px;
    margin-bottom: 10px;
}

.th-template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 9px 5px;
    border: 1.5px solid rgba(201, 141, 123, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-template-card:active { transform: scale(0.96); }

.th-template-card__plan {
    width: 100%;
    border-radius: 9px;
    overflow: hidden;
}

.th-template-card__name {
    font-size: 10.5px;
    font-weight: 700;
    color: #6d564a;
    text-align: center;
    line-height: 1.4;
}

.th-custom-preview {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.th-custom-floor small {
    display: block;
    margin: 0 2px 4px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(92, 74, 64, 0.6);
}

/* ============================ AI 户型图平面图（生成图 + 透明可点区域） ============================
   生成图取代矩形图：.th-artplan__stage 用 padding 撑出图片比例，图片与 SVG 命中层绝对铺满，
   房间名标签贴在框中心。命中区默认全透明，按下时浮出一层淡色，让用户知道点中了哪间房。 */

.th-artplan {
    position: relative;
    width: 100%;
}

.th-artplan__stage {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(246, 236, 226, 0.9), rgba(236, 226, 218, 0.9));
}

.th-artplan__ratio {
    display: block;
    width: 100%;
    height: 0;
}

.th-artplan__img,
.th-artplan__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.th-artplan__img {
    display: block;
    object-fit: fill;
    background: #fdf9f3;
}

/* 图片仍在从 IndexedDB 读取：先给一道柔和的呼吸底 */
.th-artplan__img:not([src]) {
    opacity: 0;
}

.th-artplan__stage:has(.th-artplan__img:not([src]))::before {
    content: '';
    position: absolute;
    inset: 0;
    animation: th-plan-art-breathe 1.4s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.35);
}

@keyframes th-plan-art-breathe {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.9; }
}

.th-artplan__overlay { display: block; }

.th-artplan__room rect {
    fill: rgba(255, 255, 255, 0);
    stroke: none;
    transition: fill 120ms ease-out;
}

/* 区域可能由多块拼成（L 形、被小房间切掉一角）：只描这间房自己的外轮廓，不描内部接缝 */
.th-artplan__outline {
    fill: none;
    stroke: rgba(192, 123, 102, 0);
    stroke-width: 0.6;
    stroke-linecap: square;
    vector-effect: non-scaling-stroke;
    transition: stroke 120ms ease-out;
}

.th-artplan__room:active rect,
.th-artplan__room:hover rect {
    fill: rgba(216, 154, 134, 0.22);
}

.th-artplan__room:active .th-artplan__outline,
.th-artplan__room:hover .th-artplan__outline {
    stroke: rgba(192, 123, 102, 0.85);
    stroke-width: 2;
}

.th-artplan--mini .th-artplan__room rect { pointer-events: none; }

.th-artplan__tag {
    position: absolute;
    transform: translate(-50%, -50%);
    max-width: 42%;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(176, 154, 142, 0.5);
    box-shadow: 0 2px 6px rgba(73, 52, 43, 0.14);
    color: #5c4a40;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.th-artplan__tag:active { background: rgba(216, 154, 134, 0.9); color: #fff; }

.th-artplan__zoom {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(73, 52, 43, 0.18);
    color: #6d564a;
    font-size: 14px;
    line-height: 28px;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
}

/* 模型没在图上认出来的房间：给一排可点的小按钮，任何房间都不能因此进不去 */
.th-artplan__missing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 4px 2px;
}

.th-artplan__missing small {
    font-size: 11px;
    color: rgba(92, 74, 64, 0.55);
    margin-right: 2px;
}

.th-artplan__chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 141, 123, 0.4);
    background: rgba(255, 255, 255, 0.8);
    color: #6d564a;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-plan-wrap--art { padding: 6px; }

/* 住所卡片缩略图：成图铺满 58×58 */
.th-home-card__plan--art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.th-home-card__plan--art img:not([src]) { opacity: 0; }

.th-plan-art--pending {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 14px 12px;
    margin: 0 0 8px;
    font-size: 12px;
    color: rgba(92, 74, 64, 0.7);
    cursor: default;
}

.th-plan-art__spinner {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(192, 123, 102, 0.25);
    border-top-color: rgba(192, 123, 102, 0.9);
    animation: th-plan-art-spin 0.9s linear infinite;
}

@keyframes th-plan-art-spin { to { transform: rotate(360deg); } }

/* 全屏查看：与确认弹窗同级，点任意位置关闭 */
.th-plan-art-viewer {
    position: absolute;
    inset: 0;
    z-index: 2715;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 12px 22px;
    background: rgba(40, 30, 25, 0.92);
    opacity: 0;
    transition: opacity 180ms ease-out;
    cursor: zoom-out;
}

.th-plan-art-viewer.is-open { opacity: 1; }

.th-plan-art-viewer__body {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

.th-plan-art-viewer__body img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
    background: #fdf9f3;
}

.th-plan-art-viewer__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 22px;
    line-height: 34px;
    cursor: pointer;
}

.th-plan-art-viewer__cap {
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.th-plan-art-viewer__cap small {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================ 平面图（SVG） ============================ */

.th-plan {
    display: block;
    width: 100%;
    height: auto;
}

.th-plan--mini { pointer-events: none; }

.th-plan-wrap {
    margin: 4px 2px;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 12px 28px rgba(139, 109, 92, 0.14);
    padding: 8px;
}

.th-plan-room { cursor: pointer; }
.th-plan--mini .th-plan-room { cursor: default; }
.th-plan-room:active rect { filter: brightness(0.93); }

/* 平面图人物：SVG 尺寸由 tiny-home.js 按当前房间短边实时计算；这里仅负责皮肤。
   整组禁用命中，头像盖在房间上时点击仍会穿透到 .th-plan-room。 */
.th-plan-presence,
.th-plan-presence * {
    pointer-events: none;
}

.th-plan-presence {
    animation: th-plan-presence-arrive 260ms ease-out both;
}

.th-plan-presence__shadow {
    fill: rgba(73, 52, 43, 0.2);
}

.th-plan-presence__frame {
    fill: #fffdf9;
    stroke: #fffdf9;
}

.th-plan-presence__person--char .th-plan-presence__frame {
    stroke: #bf806d;
}

.th-plan-presence__person--user .th-plan-presence__frame {
    stroke: #7d9b84;
}

.th-plan-presence__fallback {
    fill: #c98d7b;
}

.th-plan-presence__person--user .th-plan-presence__fallback {
    fill: #7d9b84;
}

.th-plan-presence__initial {
    fill: #fff;
    font-weight: 800;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@keyframes th-plan-presence-arrive {
    from { opacity: 0.28; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .th-plan-presence { animation: none; }
}

.th-floor-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scrollbar-width: none;
}

.th-floor-tabs::-webkit-scrollbar { display: none; }

.th-floor-tab {
    flex: 0 0 auto;
    min-width: 52px;
    padding: 7px 14px;
    border: 1.5px solid rgba(201, 141, 123, 0.34);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.66);
    color: #6d564a;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-floor-tab.is-active {
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    border-color: transparent;
    color: #fff;
}

/* ============================ 公寓详情信息卡 ============================ */

.th-apt-info {
    margin: 2px 2px 12px;
    padding: 13px 15px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(139, 109, 92, 0.13);
}

.th-apt-info__addr {
    font-size: 15px;
    font-weight: 800;
    color: #4a3a32;
    line-height: 1.5;
    word-break: break-all;
}

.th-apt-info__meta {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(92, 74, 64, 0.62);
}

.th-apt-info__residents {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.th-mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 4px;
    border-radius: 999px;
    background: rgba(201, 141, 123, 0.13);
    border: 1px solid rgba(201, 141, 123, 0.3);
    font-size: 11.5px;
    font-weight: 700;
    color: #6d564a;
}

.th-mini-chip__avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    background: linear-gradient(135deg, #d8a08c 0%, #a8705d 100%);
}

.th-mini-chip__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.th-mini-chip__role {
    margin-left: 2px;
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(201, 141, 123, 0.18);
    color: #9a6555;
    font-size: 9px;
    font-weight: 800;
}

/* 同居详情：长按住户头像取消居住权；抑制选中与系统呼出菜单 */
.th-mini-chip--revoke {
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.th-mini-chip--revoke img {
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ============================ 通用确认 / 仓库 独立层 ============================ */

.th-confirm-host,
.th-warehouse-host {
    position: absolute;
    inset: 0;
}

.th-warehouse-host { z-index: 2712; }
.th-confirm-host {
    z-index: 2714;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(60, 44, 36, 0.44);
}

.th-warehouse-host .th-modal-mask { position: absolute; }

.th-confirm {
    box-sizing: border-box;
    width: 100%;
    max-width: 300px;
    border-radius: 18px;
    background: #fdf9f3;
    box-shadow: 0 22px 52px rgba(60, 44, 36, 0.4);
    padding: 16px 16px 14px;
}

.th-confirm__title {
    font-size: 15px;
    font-weight: 800;
    color: #5c4a40;
    margin-bottom: 8px;
}

/* 临时入口密码输入框（内测门禁，正式公开时随 JS 门禁一并移除） */
.th-confirm .th-pass-input {
    margin: 2px 0 12px;
    letter-spacing: 2px;
}

/* 造访门禁弹窗（tiny-home-visit.js：还未获得邀请 → 询问TA / 输密码） */
.th-visit .th-confirm__btns { flex-wrap: wrap; }

.th-visit-denied {
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 9px;
    background: rgba(196, 92, 74, 0.09);
    color: #a4523f;
    font-size: 12px;
    line-height: 1.55;
}

.th-visit-pass-tip {
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 9px;
    background: rgba(122, 158, 108, 0.12);
    color: #587a4b;
    font-size: 12px;
    line-height: 1.55;
}

.th-visit-passrow .th-pass-input { margin: 6px 0 12px; }

html[data-appearance="dark"] .th-visit-denied {
    background: rgba(196, 92, 74, 0.16);
    color: #e0a396;
}

html[data-appearance="dark"] .th-visit-pass-tip {
    background: rgba(122, 158, 108, 0.18);
    color: #b5cfa8;
}

.th-confirm__body {
    font-size: 13px;
    line-height: 1.7;
    color: #6d564a;
    margin-bottom: 14px;
    white-space: pre-line; /* 长说明（如一键整装须知）按 \n 分段显示 */
}

.th-confirm__btns {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

/* AI 小助手的卧室归属选择框：每位住户都是独立选项，兼容多于两位同居者。 */
.thr-owner-picker { max-width: 340px; }

.thr-owner-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 2px 0 14px;
}

.thr-owner-choice {
    min-width: 0;
    padding: 11px 9px;
    border: 1px solid rgba(201, 141, 123, 0.34);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.78);
    color: #5c4a40;
    text-align: left;
    cursor: pointer;
}

.thr-owner-choice strong,
.thr-owner-choice small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thr-owner-choice strong { font-size: 13px; }
.thr-owner-choice small { margin-top: 3px; color: rgba(109, 86, 74, 0.58); font-size: 10px; }

.thr-owner-choice.is-current {
    border-color: rgba(192, 123, 102, 0.7);
    background: rgba(216, 154, 134, 0.16);
}

/* ---------------- 装修仓库：铺满小手机，顶部检索与分类常驻 ---------------- */

.th-warehouse-host {
    --th-wh-surface: #fdf9f3;
    --th-wh-card: #fff;
    --th-wh-ink: #5c4a40;
    --th-wh-muted: #806b5d;
    --th-wh-accent: #8a6355;
    --th-wh-primary: #8a6355;
    --th-wh-primary-ink: #fff;
    --th-wh-soft: #f7efe6;
    --th-wh-selected: #eee0d4;
    --th-wh-line: rgba(201, 141, 123, 0.3);
    --th-wh-focus: #8a6355;
    --th-wh-danger: #b0574b;
    --th-wh-checker: rgba(201, 141, 123, 0.08);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--th-wh-surface);
    color: var(--th-wh-ink);
    isolation: isolate;
}

.th-warehouse-host,
.th-warehouse-host * { box-sizing: border-box; }
.th-warehouse-host [hidden] { display: none !important; }

.th-warehouse-host .th-wh-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    background: var(--th-wh-surface);
}

.th-warehouse-host .th-wh-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(10px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px 10px;
    padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
    border-bottom: 1px solid var(--th-wh-line);
}

.th-warehouse-host .th-wh-header h3 {
    min-width: 0;
    margin: 0;
    color: var(--th-wh-ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.th-warehouse-host .th-wh-header h3 small {
    display: inline-block;
    margin-left: 8px;
    color: var(--th-wh-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.th-warehouse-host [data-wh-close] {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--th-wh-soft);
    color: var(--th-wh-accent);
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.th-warehouse-host .th-wh-tools {
    flex: 0 0 auto;
    min-width: 0;
    padding: 12px 16px 0;
    padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
}

.th-warehouse-host .th-wh-search-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.th-warehouse-host [data-wh-search] {
    display: block;
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--th-wh-line);
    border-radius: 12px;
    background: var(--th-wh-card);
    color: var(--th-wh-ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
    caret-color: var(--th-wh-accent);
    scroll-margin: 12px;
}

.th-warehouse-host [data-wh-search]::placeholder { color: var(--th-wh-muted); opacity: 1; }
.th-warehouse-host [data-wh-search]::-webkit-search-cancel-button { display: none; }
.th-warehouse-host [data-wh-search][aria-invalid="true"] { border-color: var(--th-wh-danger); }

.th-warehouse-host [data-wh-clear] {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 0;
    border-radius: 10px;
    background: var(--th-wh-soft);
    color: var(--th-wh-accent);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.th-warehouse-host .th-wh-categories {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    padding: 10px 0 0;
}

.th-warehouse-host .th-wh-categories [data-wh-category] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 54px;
    padding: 6px 2px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--th-wh-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}

.th-warehouse-host .th-wh-categories [data-wh-category] span { white-space: nowrap; }
.th-warehouse-host .th-wh-categories [data-wh-category] small { font-size: 11px; font-weight: 400; }
.th-warehouse-host .th-wh-categories [aria-selected="true"] {
    border-color: var(--th-wh-line);
    background: var(--th-wh-selected);
    color: var(--th-wh-ink);
    font-weight: 800;
    box-shadow: inset 0 -2px 0 var(--th-wh-accent);
}

.th-warehouse-host .th-wh-summary {
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 0 12px;
    color: var(--th-wh-muted);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.th-warehouse-host .th-wh-scroll {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2px 16px max(16px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--th-wh-line) transparent;
    scroll-padding-block: 10px;
}

.th-warehouse-host .th-wh-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
    align-items: stretch;
}

.th-warehouse-host .th-wh-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    background: var(--th-wh-card);
    border: 1px solid var(--th-wh-line);
    box-shadow: none;
}

.th-warehouse-host .th-wh-item__img {
    position: relative;
    display: block;
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background:
        repeating-conic-gradient(var(--th-wh-checker) 0% 25%, transparent 0% 50%) 0 0 / 18px 18px,
        var(--th-wh-card);
}

.th-warehouse-host .th-wh-item__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.th-warehouse-host .th-wh-item__img:not([data-state="ready"]) img { opacity: 0; }
.th-warehouse-host .th-wh-item__img[data-state="ready"] .th-wh-image-state { display: none; }
.th-warehouse-host .th-wh-image-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--th-wh-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}
.th-warehouse-host .th-wh-item__img[data-state="error"] .th-wh-image-state { color: var(--th-wh-danger); }

.th-warehouse-host .th-wh-item__label {
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--th-wh-ink);
    overflow-wrap: anywhere;
    white-space: normal;
}

.th-warehouse-host .th-wh-item__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin-top: auto;
}

.th-warehouse-host .th-wh-item__btns .th-btn {
    flex: 1 1 60px;
    min-width: 0;
    min-height: 44px;
    padding: 8px 4px;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: none;
}
.th-warehouse-host .th-wh-item__btns .th-btn--danger-ghost { color: var(--th-wh-danger); }
.th-warehouse-host .th-wh-item__btns .th-btn--primary {
    border-color: transparent;
    background: var(--th-wh-primary);
    color: var(--th-wh-primary-ink);
}
.th-warehouse-host .th-wh-empty,
.th-warehouse-host .th-wh-scroll > .th-empty {
    margin: 24px 0;
    padding: 24px 16px;
    border: 1px dashed var(--th-wh-line);
    border-radius: 14px;
    background: var(--th-wh-card);
    color: var(--th-wh-muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.th-warehouse-host .th-wh-empty strong { display: block; color: var(--th-wh-ink); font-size: 15px; }
.th-warehouse-host .th-wh-empty p { margin: 6px 0 12px; }
.th-warehouse-host .th-wh-empty .th-btn { min-height: 44px; }

.th-warehouse-host :is(button, input):focus-visible {
    outline: 3px solid var(--th-wh-focus);
    outline-offset: 2px;
}
.th-warehouse-host button { -webkit-tap-highlight-color: transparent; }
.th-warehouse-host button:disabled { opacity: 0.5; cursor: not-allowed; }
.th-warehouse-host button[aria-busy="true"] { cursor: progress; }
.th-warehouse-host button:active:not(:disabled) { transform: scale(0.97); }

@media (hover: hover) {
    .th-warehouse-host :is([data-wh-close], [data-wh-clear]):hover:not(:disabled),
    .th-warehouse-host .th-wh-categories [data-wh-category]:hover:not(:disabled) {
        background: var(--th-wh-selected);
        color: var(--th-wh-ink);
    }
    .th-warehouse-host .th-wh-item__btns .th-btn:hover:not(:disabled) { border-color: var(--th-wh-accent); }
    .th-warehouse-host .th-wh-item__btns .th-btn--danger-ghost:hover:not(:disabled) {
        border-color: var(--th-wh-danger);
        background: var(--th-wh-soft);
    }
}

@media (max-width: 320px) {
    .th-warehouse-host .th-wh-header { gap: 8px; }
    .th-warehouse-host .th-wh-header h3 { font-size: 18px; }
    .th-warehouse-host .th-wh-header h3 small { margin-left: 4px; font-size: 11px; }
    .th-warehouse-host :is(.th-wh-header, .th-wh-tools, .th-wh-scroll) {
        padding-left: max(12px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
        padding-right: max(12px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
    }
    .th-warehouse-host .th-wh-grid { gap: 8px; }
    .th-warehouse-host .th-wh-item { padding: 8px; }
    .th-warehouse-host .th-wh-categories [data-wh-category] { font-size: 12px; }
}

.th-warehouse-host.lovemi-overlay-kb-active .th-wh-tools { padding-top: 6px; }
.th-warehouse-host.lovemi-overlay-kb-active .th-wh-categories { padding-top: 6px; }
.th-warehouse-host.lovemi-overlay-kb-active .th-wh-categories [data-wh-category] { min-height: 44px; }
.th-warehouse-host.lovemi-overlay-kb-active .th-wh-categories small { display: none; }
.th-warehouse-host.lovemi-overlay-kb-active .th-wh-summary { padding-block: 4px; }

@media (max-height: 420px) {
    .th-warehouse-host .th-wh-header { padding-bottom: 6px; }
    .th-warehouse-host .th-wh-tools { padding-top: 6px; }
    .th-warehouse-host .th-wh-categories { padding-top: 6px; }
    .th-warehouse-host .th-wh-categories [data-wh-category] { min-height: 44px; gap: 0; padding-block: 3px; }
    .th-warehouse-host .th-wh-summary { padding-block: 4px; }
    .th-warehouse-host .th-wh-item__img {
        height: min(96px, 26vh);
        aspect-ratio: auto;
        padding-bottom: 0;
    }
}

html[data-appearance="dark"] .th-warehouse-host {
    --th-wh-surface: #261f1a;
    --th-wh-card: #302721;
    --th-wh-ink: #f0e4da;
    --th-wh-muted: #c9b4a6;
    --th-wh-accent: #d89a86;
    --th-wh-primary: #8f523f;
    --th-wh-soft: #3a2f28;
    --th-wh-selected: #49372e;
    --th-wh-line: rgba(201, 141, 123, 0.34);
    --th-wh-focus: #d89a86;
    --th-wh-danger: #e08a72;
    --th-wh-checker: rgba(224, 207, 194, 0.08);
}

html[data-appearance="dark"] .th-warehouse-host .th-wh-item {
    background: var(--th-wh-card);
    border-color: var(--th-wh-line);
    box-shadow: none;
}

html[data-appearance="dark"] .th-warehouse-host .th-wh-item__btns .th-btn--primary {
    border-color: transparent;
    background: var(--th-wh-primary);
    color: var(--th-wh-primary-ink);
}

/* ============================ 房间装修层（thr-） ============================ */

/* 画布撑满顶栏与工具条之间的全部空间，消灭屏下空白 */
.thr-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    position: relative;
    padding: 12px 12px 6px;
}

/* 同居卧室的明确归属：常驻可见且可重新选择，避免一次误点后无处纠正。 */
.thr-room-owner-chip {
    position: absolute;
    z-index: 26;
    top: 20px;
    left: 20px;
    max-width: calc(100% - 40px);
    min-height: 30px;
    padding: 6px 10px;
    overflow: hidden;
    border: 1px solid rgba(201, 141, 123, 0.45);
    border-radius: 11px;
    background: rgba(253, 249, 243, 0.9);
    box-shadow: 0 7px 18px rgba(92, 74, 64, 0.16);
    color: #6d564a;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 800;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.thr-room-owner-chip small {
    margin-left: 6px;
    color: rgba(109, 86, 74, 0.55);
    font-size: 9.5px;
    font-weight: 700;
}

.thr-room-owner-chip.is-unset {
    border-color: rgba(190, 102, 77, 0.66);
    color: #a4513e;
    animation: thr-owner-nudge 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .thr-room-owner-chip.is-unset {
        animation: none;
    }
}

@keyframes thr-owner-nudge {
    0%, 100% { box-shadow: 0 7px 18px rgba(92, 74, 64, 0.16); }
    50% { box-shadow: 0 7px 22px rgba(190, 102, 77, 0.34); }
}

.thr-canvas {
    position: relative;
    /* 画布内部的热点/贴纸/拖动提示各有 z-index，收进画布自己的层叠上下文，
       不让它们越过侧边栏菜单、弹窗遮罩等画布之外的覆盖层 */
    isolation: isolate;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #f4ece1;
    box-shadow: 0 14px 32px rgba(139, 109, 92, 0.2);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.thr-canvas.is-pannable:not(.is-decor) { cursor: grab; }
.thr-canvas.is-pannable.is-panning:not(.is-decor) { cursor: grabbing; }

.thr-canvas[tabindex]:focus-visible {
    outline: 3px solid rgba(192, 123, 102, 0.72);
    outline-offset: 2px;
}

/* 底图在窄长视口中按 cover 铺满；检测到水平裁切后短暂提示可拖动。
   提示层不接管命中，家具/热点和画布手势仍能从其下方正常开始。 */
.thr-canvas.is-pannable:not(.is-decor)::after {
    content: '↔  左右拖动查看完整画面';
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 80;
    transform: translateX(-50%);
    max-width: calc(100% - 28px);
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(55, 42, 35, 0.68);
    color: #fffaf3;
    box-shadow: 0 5px 16px rgba(34, 24, 19, 0.24);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    animation: thr-pan-affordance 3.4s ease forwards;
}

.thr-canvas.is-pannable.is-panning:not(.is-decor)::after { opacity: 0; }

@keyframes thr-pan-affordance {
    0%, 12% { opacity: 0; transform: translateX(-50%) translateY(5px); }
    24%, 70% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .thr-canvas.is-pannable:not(.is-decor)::after { animation: none; opacity: 0; }
}

.thr-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none;
    max-height: none;
    display: block;
    pointer-events: none;
}

.thr-base-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.thr-base-placeholder span {
    font-size: 20px;
    font-weight: 800;
    color: rgba(92, 74, 64, 0.55);
    letter-spacing: 2px;
}

.thr-base-placeholder small {
    font-size: 11.5px;
    color: rgba(92, 74, 64, 0.42);
}

/* 整装底图上的物品热点：平时完全透明，按下时浮出柔光框提示命中；
   进房时中心微光闪两下（is-hint 动画播完自然消失），提示这里可以点 */
.thr-hotspot {
    position: absolute;
    z-index: 5; /* 低于贴纸（10+），贴纸叠上来时优先点到贴纸 */
    cursor: pointer;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
}

.thr-hotspot:active {
    background: rgba(255, 244, 224, 0.16);
    box-shadow: inset 0 0 0 2px rgba(255, 235, 205, 0.6);
}

.thr-hotspot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: rgba(255, 250, 240, 0.95);
    box-shadow: 0 0 0 4px rgba(201, 141, 123, 0.35), 0 0 14px rgba(255, 236, 200, 0.9);
    opacity: 0;
    pointer-events: none;
}

.thr-hotspot.is-hint::after {
    animation: thr-hotspot-hint 1.1s ease-in-out 2;
}

@keyframes thr-hotspot-hint {
    0%, 100% { opacity: 0; transform: scale(0.6); }
    50% { opacity: 1; transform: scale(1); }
}

.thr-sticker {
    position: absolute;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

/* 浏览模式的贴纸与底图共享视角偏移；装修模式始终回到中心坐标系。 */
.thr-canvas:not(.is-decor) .thr-sticker {
    margin-left: var(--thr-pan-x, 0px);
}

.thr-canvas.is-decor .thr-sticker {
    cursor: grab;
    touch-action: none; /* 触屏拖动/手柄操作时不触发页面滚动 */
}
.thr-canvas.is-decor .thr-sticker:active { cursor: grabbing; }

.thr-sticker img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    filter: drop-shadow(0 3px 7px rgba(60, 44, 36, 0.18));
}

/* 白底贴纸与底图融合：multiply 让纯白背景视觉上消失。
   必须放在贴纸容器上——容器带 z-index 会形成独立层叠上下文，
   若把 mix-blend-mode 放在内部 img 上只会与空容器混合、完全不生效。 */
.thr-sticker.is-blend { mix-blend-mode: multiply; }

.thr-sticker.is-selected {
    outline: 2px dashed rgba(192, 123, 102, 0.9);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------------- 贴纸变形手柄 ----------------
   手柄是贴纸容器的子元素，会随容器一起旋转（符合直觉：手柄贴着贴图转）；
   scale(var(--thr-ix), var(--thr-iy)) 抵消容器的水平翻转与纵向拉伸，
   避免手柄图标被镜像或压扁。 */

.thr-h {
    position: absolute;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #b96a52;
    color: #fff7f0;
    border: 1.5px solid rgba(255, 247, 240, 0.95);
    box-shadow: 0 2px 6px rgba(60, 44, 36, 0.4);
    font-style: normal;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 4;
    transform: scale(var(--thr-ix, 1), var(--thr-iy, 1));
}

.thr-h:active { background: #a05540; }

/* 顶部中央：自由旋转（虚线小连杆连到贴图顶边） */
.thr-h--rot {
    left: 50%;
    top: -40px;
    margin-left: -11px;
    cursor: grab;
}
.thr-h--rot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 21px;
    height: 17px;
    border-left: 1.5px dashed rgba(192, 123, 102, 0.9);
}

/* 左上：水平翻转（点按切换） */
.thr-h--flip { left: -11px; top: -11px; }

/* 右下：等比缩放 */
.thr-h--scale { right: -11px; bottom: -11px; cursor: nwse-resize; }

/* 右边中点：横向拉伸；底边中点：纵向拉伸 */
.thr-h--sx { right: -11px; top: 50%; margin-top: -11px; cursor: ew-resize; }
.thr-h--sy { bottom: -11px; left: 50%; margin-left: -11px; cursor: ns-resize; }

/* 左下：扭曲（skew 倾斜，贴合墙线/地面透视） */
.thr-h--skew { left: -11px; bottom: -11px; cursor: move; }

/* 旋转时跟随显示的角度提示 */
.thr-rot-tip {
    position: absolute;
    transform: translate(-50%, -100%);
    padding: 3px 9px;
    border-radius: 9px;
    background: rgba(60, 46, 38, 0.86);
    color: #fff7f0;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 400;
}

/* ---------------- 装修工具条 ---------------- */

.thr-toolbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    gap: 9px;
    padding: 8px 12px;
}

.thr-tool {
    min-width: 62px;
    padding: 9px 8px;
    border: 1px solid rgba(201, 141, 123, 0.36);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.78);
    color: #6d564a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.thr-tool:active { transform: scale(0.95); }

/* ---------------- 贴纸控制条 ---------------- */

.thr-sticker-ctrl {
    position: absolute;
    left: 50%;
    bottom: max(14px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(60, 44, 36, 0.86);
    box-shadow: 0 12px 28px rgba(60, 44, 36, 0.4);
    max-width: calc(100% - 20px);
    overflow-x: auto;
    scrollbar-width: none;
}

.thr-sticker-ctrl::-webkit-scrollbar { display: none; }

.thr-sticker-ctrl__label {
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 700;
    color: rgba(255, 245, 236, 0.9);
    padding: 0 4px;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thr-sticker-ctrl button {
    flex: 0 0 auto;
    min-width: 34px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffede0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.thr-sticker-ctrl button:active { background: rgba(255, 255, 255, 0.3); }

.thr-sticker-ctrl button.is-danger {
    background: rgba(217, 117, 106, 0.34);
    color: #ffd9d2;
}

/* ---------------- AI 助手 ---------------- */

.thr-ai-ball {
    position: absolute;
    right: 14px;
    bottom: max(76px, calc(var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) + 76px));
    z-index: 32;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #d89a86 0%, #b0705a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.5px;
    box-shadow: 0 12px 26px rgba(176, 112, 90, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.thr-ai-ball:active { transform: scale(0.92); }
.thr-ai-ball.is-open { background: linear-gradient(135deg, #8a6355 0%, #6b4a3d 100%); }

.thr-ai-panel {
    position: absolute;
    right: 12px;
    left: auto;
    bottom: max(132px, calc(var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) + 132px));
    z-index: 31;
    width: min(94%, 400px);
    display: flex;
    flex-direction: column;
    max-height: 64%;
    border-radius: 18px;
    background: rgba(253, 249, 243, 0.96);
    box-shadow: 0 18px 42px rgba(60, 44, 36, 0.32);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

/* 拖动手柄：按住可把整个对话框拖到任意位置 */
.thr-ai-panel__handle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(92, 74, 64, 0.55);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    border-bottom: 1px solid rgba(201, 141, 123, 0.16);
}

.thr-ai-panel__handle:active { cursor: grabbing; }

.thr-ai-panel__handle i {
    width: 26px;
    height: 4px;
    border-radius: 999px;
    background: rgba(201, 141, 123, 0.4);
}

/* ---------------- 消息气泡互动菜单（长按 / 右键：复制 / 编辑 / 回溯） ---------------- */

.thr-msgmenu-mask {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(60, 44, 36, 0.38);
}

.thr-msgmenu {
    width: min(80%, 300px);
    border-radius: 16px;
    background: rgba(253, 249, 243, 0.99);
    box-shadow: 0 18px 42px rgba(60, 44, 36, 0.34);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.thr-msgmenu__preview {
    padding: 12px 14px 10px;
    font-size: 11.5px;
    line-height: 1.5;
    color: rgba(92, 74, 64, 0.6);
    border-bottom: 1px solid rgba(201, 141, 123, 0.18);
    word-break: break-all;
}

.thr-msgmenu__item {
    border: 0;
    background: transparent;
    padding: 13px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #5c4a40;
    cursor: pointer;
    border-bottom: 1px solid rgba(201, 141, 123, 0.14);
    -webkit-tap-highlight-color: transparent;
}

.thr-msgmenu__item:active { background: rgba(201, 141, 123, 0.12); }
.thr-msgmenu__item--danger { color: #c05b45; }
.thr-msgmenu__item--cancel { border-bottom: 0; font-weight: 400; color: rgba(92, 74, 64, 0.55); }

.thr-msgedit {
    width: min(90%, 340px);
    box-sizing: border-box;
    padding: 14px;
    border-radius: 16px;
    background: rgba(253, 249, 243, 0.99);
    box-shadow: 0 18px 42px rgba(60, 44, 36, 0.34);
    display: flex;
    flex-direction: column;
}

.thr-msgedit__title {
    font-size: 14px;
    font-weight: 700;
    color: #5c4a40;
    padding-bottom: 8px;
}

.thr-msgedit__text {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    max-height: 44vh;
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 10px;
}

.thr-msgedit__btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

html[data-appearance="dark"] .thr-msgmenu,
html[data-appearance="dark"] .thr-msgedit { background: rgba(38, 31, 26, 0.99); }

html[data-appearance="dark"] .thr-msgmenu__preview { color: rgba(224, 207, 194, 0.55); }

html[data-appearance="dark"] .thr-msgmenu__item { color: #e8d8cc; }
html[data-appearance="dark"] .thr-msgmenu__item--danger { color: #e08a72; }
html[data-appearance="dark"] .thr-msgmenu__item--cancel { color: rgba(224, 207, 194, 0.5); }

html[data-appearance="dark"] .thr-msgedit__title { color: #f0e4da; }

/* 长按气泡时抑制 iOS 文本选中与系统呼出（复制走菜单里的「复制」） */
.thr-ai-msg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 回复倒计时按钮：等待期可视、可点击立刻回复 */
.thr-ai-countdown { flex: 0 0 auto; }

.thr-ai-countdown:empty { display: none; }

.thr-ai-countdown-btn {
    display: block;
    width: calc(100% - 24px);
    margin: 2px 12px 4px;
    padding: 7px 10px;
    border: 1px dashed rgba(192, 123, 102, 0.55);
    border-radius: 999px;
    background: rgba(216, 154, 134, 0.12);
    color: #a5624d;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.thr-ai-countdown-btn:active { transform: scale(0.98); }

html[data-appearance="dark"] .thr-ai-countdown-btn {
    background: rgba(216, 154, 134, 0.14);
    border-color: rgba(216, 154, 134, 0.4);
    color: #e0b3a3;
}

.thr-ai-visionrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 12px 4px;
    font-size: 11px;
    color: rgba(92, 74, 64, 0.6);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.thr-ai-visionrow input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #c07b66;
    margin: 0;
}

.thr-ai-msgs {
    flex: 1;
    min-height: 140px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    scrollbar-width: none;
}

.thr-ai-msgs::-webkit-scrollbar { display: none; }

.thr-ai-msg {
    max-width: 86%;
    padding: 8px 11px;
    border-radius: 13px;
    font-size: 12.5px;
    line-height: 1.6;
    word-break: break-word;
}

.thr-ai-msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.thr-ai-msg--ai {
    align-self: flex-start;
    background: rgba(201, 141, 123, 0.13);
    color: #5c4a40;
    border-bottom-left-radius: 4px;
}

.thr-ai-msg--sys {
    align-self: center;
    background: transparent;
    color: rgba(92, 74, 64, 0.55);
    font-size: 11px;
    padding: 2px 8px;
}

/* Char 本人的发言气泡（装修沟通面板，与小助手区分配色） */
.thr-ai-msg--char {
    align-self: flex-start;
    background: rgba(123, 152, 201, 0.14);
    color: #43506b;
    border-bottom-left-radius: 4px;
}

/* 头像行：Char / 小助手的消息带头像与名字（仅 Char 的家启用） */
.thr-ai-msgrow {
    align-self: flex-start;
    display: flex;
    gap: 7px;
    max-width: 92%;
}

.thr-ai-msgrow .thr-ai-msg {
    align-self: flex-start;
    max-width: 100%;
}

.thr-ai-ava {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-top: 15px;
}

.thr-ai-ava--char {
    background: linear-gradient(135deg, #8ea4cf 0%, #6d84b4 100%);
    color: #fff;
}

.thr-ai-ava--bot {
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    color: #fff;
}

.thr-ai-msgcol {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.thr-ai-name {
    font-size: 10.5px;
    color: rgba(92, 74, 64, 0.55);
    padding-left: 2px;
}

/* 小助手方案确认按钮（确认后才开工） */
.thr-ai-planbtns {
    display: flex;
    gap: 6px;
    padding: 2px 0 4px;
}

.thr-ai-inputrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(201, 141, 123, 0.2);
}

.thr-ai-inputrow .thr-ai-input {
    flex: 1;
    margin: 0;
    min-height: 36px;
    padding: 8px 12px;
}

/* ---------------- 修改清单 ---------------- */

.thr-modify-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.thr-modify-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(201, 141, 123, 0.24);
    cursor: pointer;
}

.thr-modify-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #c07b66;
    flex: 0 0 auto;
}

.thr-modify-row__img {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
}

.thr-modify-row__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.thr-modify-row__label {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: #5c4a40;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- 设置抽屉 ---------------- */

.thr-set-title {
    margin: 14px 0 4px;
    font-size: 13.5px;
    font-weight: 800;
    color: #5c4a40;
}

.thr-set-title:first-child { margin-top: 0; }

.thr-set-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thr-set-row .th-select { flex: 1; min-width: 0; }

/* ============================ 暗色模式 ============================ */

html[data-appearance="dark"] .th-root,
html[data-appearance="dark"] .thr-root {
    background:
        radial-gradient(circle at 16% 10%, rgba(154, 106, 90, 0.26), transparent 44%),
        radial-gradient(circle at 86% 18%, rgba(148, 118, 88, 0.2), transparent 42%),
        linear-gradient(180deg, #221b16 0%, #171210 100%);
}

html[data-appearance="dark"] .th-head {
    background: rgba(34, 27, 22, 0.9);
    border-bottom-color: rgba(201, 141, 123, 0.2);
}

html[data-appearance="dark"] .th-head h2 { color: #f0e4da; }

html[data-appearance="dark"] .th-back,
html[data-appearance="dark"] .th-head-tool {
    background: rgba(58, 47, 40, 0.85);
    color: #e0cfc2;
    box-shadow: none;
}

html[data-appearance="dark"] .th-head-tool--primary {
    background: linear-gradient(135deg, #b0705a 0%, #8f523f 100%);
    color: #fff;
}

html[data-appearance="dark"] .th-empty {
    border-color: rgba(201, 141, 123, 0.28);
    background: rgba(48, 39, 33, 0.5);
    color: rgba(224, 207, 194, 0.6);
}

html[data-appearance="dark"] .th-hint { color: rgba(224, 207, 194, 0.42); }

html[data-appearance="dark"] .th-resident-group__head h4 { color: #e0cfc2; }
html[data-appearance="dark"] .th-resident-group__head small { color: rgba(224, 207, 194, 0.45); }

html[data-appearance="dark"] .th-resident-empty {
    background: rgba(48, 39, 33, 0.5);
    border-color: rgba(224, 207, 194, 0.25);
    color: rgba(224, 207, 194, 0.5);
}

html[data-appearance="dark"] .th-resident { background: rgba(48, 39, 33, 0.6); }

html[data-appearance="dark"] .th-resident.is-selected {
    background: rgba(58, 47, 40, 0.95);
    border-color: rgba(216, 154, 134, 0.65);
}

html[data-appearance="dark"] .th-resident__name,
html[data-appearance="dark"] .th-section-head h3 { color: #f0e4da; }

html[data-appearance="dark"] .th-section-sub { color: rgba(224, 207, 194, 0.5); }

html[data-appearance="dark"] .th-home-card,
html[data-appearance="dark"] .th-map-option,
html[data-appearance="dark"] .th-template-card,
html[data-appearance="dark"] .th-apt-info,
html[data-appearance="dark"] .th-wh-item,
html[data-appearance="dark"] .thr-modify-row {
    background: rgba(48, 39, 33, 0.84);
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

html[data-appearance="dark"] .th-home-card__main strong,
html[data-appearance="dark"] .th-map-option__name,
html[data-appearance="dark"] .th-apt-info__addr,
html[data-appearance="dark"] .th-wh-item__label,
html[data-appearance="dark"] .thr-modify-row__label { color: #f0e4da; }

html[data-appearance="dark"] .th-home-card__main small,
html[data-appearance="dark"] .th-apt-info__meta { color: rgba(224, 207, 194, 0.55); }

html[data-appearance="dark"] .th-template-card__name { color: #e0cfc2; }

html[data-appearance="dark"] .th-btn {
    background: rgba(58, 47, 40, 0.85);
    border-color: rgba(201, 141, 123, 0.3);
    color: #e0cfc2;
}

html[data-appearance="dark"] .th-btn--primary {
    background: linear-gradient(135deg, #b0705a 0%, #8f523f 100%);
    border-color: transparent;
    color: #fff;
}

html[data-appearance="dark"] .th-btn--danger {
    background: linear-gradient(135deg, #a8564b 0%, #83382f 100%);
    border-color: transparent;
    color: #fff;
}

html[data-appearance="dark"] .th-modal,
html[data-appearance="dark"] .th-confirm {
    background: #261f1a;
}

html[data-appearance="dark"] .th-modal__head {
    border-bottom-color: rgba(201, 141, 123, 0.2);
}

html[data-appearance="dark"] .th-modal__head h3,
html[data-appearance="dark"] .th-confirm__title { color: #f0e4da; }

html[data-appearance="dark"] .th-modal__foot {
    border-top-color: rgba(201, 141, 123, 0.2);
}

html[data-appearance="dark"] .th-wiz-tip,
html[data-appearance="dark"] .th-confirm__body { color: #d3bfb2; }

html[data-appearance="dark"] .th-wiz-note { color: rgba(224, 207, 194, 0.5); }

html[data-appearance="dark"] .th-input,
html[data-appearance="dark"] .th-textarea,
html[data-appearance="dark"] .th-select {
    background: rgba(58, 47, 40, 0.9);
    border-color: rgba(201, 141, 123, 0.3);
    color: #f0e4da;
}

html[data-appearance="dark"] .th-combo__list { background: #3a2f28; border-color: rgba(201, 141, 123, 0.3); }
html[data-appearance="dark"] .th-combo__opt { color: #f0e4da; }
html[data-appearance="dark"] .th-combo__group,
html[data-appearance="dark"] .th-combo__caret { color: #c9a594; }

html[data-appearance="dark"] .th-plan-wrap { background: rgba(48, 39, 33, 0.66); }
html[data-appearance="dark"] .th-artplan__stage { background: linear-gradient(135deg, rgba(64, 52, 45, 0.9), rgba(52, 42, 36, 0.9)); }
html[data-appearance="dark"] .th-artplan__tag,
html[data-appearance="dark"] .th-artplan__zoom,
html[data-appearance="dark"] .th-artplan__chip { background: rgba(48, 39, 33, 0.88); color: #e6d6c8; border-color: rgba(201, 141, 123, 0.35); }
html[data-appearance="dark"] .th-artplan__missing small { color: rgba(224, 207, 194, 0.55); }
html[data-appearance="dark"] .th-plan-art--pending { background: rgba(48, 39, 33, 0.7); color: rgba(224, 207, 194, 0.6); }

html[data-appearance="dark"] .th-floor-tab {
    background: rgba(48, 39, 33, 0.7);
    border-color: rgba(201, 141, 123, 0.28);
    color: #e0cfc2;
}

html[data-appearance="dark"] .thr-canvas { background: #2c241e; }

html[data-appearance="dark"] .thr-hotspot:active {
    background: rgba(201, 141, 123, 0.14);
    box-shadow: inset 0 0 0 2px rgba(201, 141, 123, 0.5);
}

html[data-appearance="dark"] .thr-base-placeholder span { color: rgba(224, 207, 194, 0.55); }
html[data-appearance="dark"] .thr-base-placeholder small { color: rgba(224, 207, 194, 0.4); }

html[data-appearance="dark"] .thr-tool {
    background: rgba(58, 47, 40, 0.85);
    border-color: rgba(201, 141, 123, 0.3);
    color: #e0cfc2;
}

html[data-appearance="dark"] .thr-ai-panel { background: rgba(38, 31, 26, 0.97); }

html[data-appearance="dark"] .thr-ai-msg--ai {
    background: rgba(201, 141, 123, 0.16);
    color: #e8d8cc;
}

html[data-appearance="dark"] .thr-ai-msg--sys { color: rgba(224, 207, 194, 0.5); }

html[data-appearance="dark"] .thr-ai-msg--char {
    background: rgba(123, 152, 201, 0.2);
    color: #cdd8ee;
}

html[data-appearance="dark"] .thr-ai-name { color: rgba(224, 207, 194, 0.5); }

html[data-appearance="dark"] .thr-ai-panel__handle {
    color: rgba(224, 207, 194, 0.5);
    border-bottom-color: rgba(201, 141, 123, 0.16);
}

html[data-appearance="dark"] .thr-ai-visionrow { color: rgba(224, 207, 194, 0.55); }

html[data-appearance="dark"] .thr-set-title { color: #f0e4da; }

html[data-appearance="dark"] .th-mini-chip {
    background: rgba(201, 141, 123, 0.14);
    color: #e0cfc2;
}

html[data-appearance="dark"] .th-mini-chip__role {
    background: rgba(216, 154, 134, 0.18);
    color: #e3ad9a;
}

html[data-appearance="dark"] .thr-room-owner-chip {
    border-color: rgba(216, 154, 134, 0.35);
    background: rgba(39, 31, 26, 0.88);
    color: #eadbd0;
}

html[data-appearance="dark"] .thr-room-owner-chip small { color: rgba(234, 219, 208, 0.58); }

html[data-appearance="dark"] .thr-owner-choice {
    border-color: rgba(216, 154, 134, 0.3);
    background: rgba(255, 255, 255, 0.06);
    color: #eadbd0;
}

html[data-appearance="dark"] .thr-owner-choice small { color: rgba(234, 219, 208, 0.58); }

html[data-appearance="dark"] .thr-owner-choice.is-current {
    border-color: rgba(216, 154, 134, 0.65);
    background: rgba(216, 154, 134, 0.15);
}

/* ============================ 房间 · 顶栏「更多」与侧边栏功能菜单 ============================ */

/* 房间页头部右列：浏览模式只有 38px 的「更多」（与左侧返回键等宽，标题居中）；
   装修模式再并排一个「保存」，右列改自适应宽 */
.thr-panel .th-head { grid-template-columns: 42px 1fr auto; }

.thr-head-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 38px;
}

.thr-head-tools .th-head-tool { position: relative; }

.thr-more-btn {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #5c4a40;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 18px rgba(92, 74, 64, 0.1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.16s ease, background-color 0.16s ease;
}

.thr-more-btn:active { transform: scale(0.95); }

.thr-more-btn.is-active {
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(192, 123, 102, 0.34);
}

.thr-more-btn__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 100%;
}

.thr-more-btn__dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    transition: transform 0.22s ease;
}

.thr-more-btn.is-active .thr-more-btn__dots i:nth-child(1) { transform: translateX(3px); }
.thr-more-btn.is-active .thr-more-btn__dots i:nth-child(3) { transform: translateX(-3px); }

/* 识物进行中：三点轮流呼吸，提示后台还在识别 */
.thr-more-btn.is-busy .thr-more-btn__dots i { animation: thr-more-pulse 1.1s ease-in-out infinite; }
.thr-more-btn.is-busy .thr-more-btn__dots i:nth-child(2) { animation-delay: 0.18s; }
.thr-more-btn.is-busy .thr-more-btn__dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes thr-more-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.1); }
}

.thr-more-btn .thr-memo-badge { top: -5px; right: -5px; }

/* ============================ 动态全屏 ============================
   房间画布铺满整块手机屏幕：舞台去掉边距与圆角，顶栏改为悬浮在画面上方（半透明渐变），
   10 秒无操作后顶栏变淡（.is-dimmed），单击不响应、双击顶栏按钮恢复。 */
.thr-panel.is-motion-fullscreen > .th-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(250, 245, 238, 0.86) 0%, rgba(250, 245, 238, 0.62) 70%, rgba(250, 245, 238, 0) 100%);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: opacity 0.6s ease;
}

.thr-panel.is-motion-fullscreen > .th-head h2 { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }

.thr-panel.is-motion-fullscreen > .th-head.is-dimmed { opacity: 0.32; }
.thr-panel.is-motion-fullscreen > .th-head.is-dimmed .th-back,
.thr-panel.is-motion-fullscreen > .th-head.is-dimmed .thr-more-btn { box-shadow: none; }

/* 变淡状态下第一次单击：提示需要双击 */
.thr-panel.is-motion-fullscreen > .th-head.is-hinting::after {
    content: '再点一次恢复操作';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 4px);
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(55, 42, 35, 0.78);
    color: #fffaf3;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
}

.thr-panel.is-motion-fullscreen > .thr-stage { padding: 0; }

.thr-panel.is-motion-fullscreen .thr-canvas {
    border-radius: 0;
    box-shadow: none;
}

/* 卧室归属芯片让出悬浮顶栏的位置 */
.thr-panel.is-motion-fullscreen .thr-room-owner-chip {
    top: calc(66px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    left: 12px;
}

/* 底部拖动提示避开手机安全区 */
.thr-panel.is-motion-fullscreen .thr-canvas.is-pannable:not(.is-decor)::after {
    bottom: calc(14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

html[data-appearance="dark"] .thr-panel.is-motion-fullscreen > .th-head {
    background: linear-gradient(180deg, rgba(34, 27, 22, 0.86) 0%, rgba(34, 27, 22, 0.6) 70%, rgba(34, 27, 22, 0) 100%);
}

html[data-appearance="dark"] .thr-panel.is-motion-fullscreen > .th-head h2 { text-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    .thr-panel.is-motion-fullscreen > .th-head { transition: none; }
}

/* 侧边栏层：铺满房间层，遮罩淡入 + 抽屉从右侧滑入；层级压在弹窗遮罩(40)之下 */
.thr-menu-layer {
    position: absolute;
    inset: 0;
    z-index: 38;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    pointer-events: none;
}

.thr-menu-layer.is-open { pointer-events: auto; }

.thr-menu-mask {
    position: absolute;
    inset: 0;
    background: rgba(60, 44, 36, 0.38);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.26s ease;
}

.thr-menu-layer.is-open .thr-menu-mask { opacity: 1; }

.thr-menu {
    position: relative;
    box-sizing: border-box;
    width: min(76%, 300px);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: max(10px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    padding-bottom: max(14px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    background:
        radial-gradient(circle at 90% 6%, rgba(232, 196, 160, 0.28), transparent 46%),
        linear-gradient(180deg, #fdf9f3 0%, #f6ede2 100%);
    border-left: 1px solid rgba(201, 141, 123, 0.28);
    box-shadow: -18px 0 44px rgba(60, 44, 36, 0.22);
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.28, 1);
    outline: none;
}

.thr-menu-layer.is-open .thr-menu { transform: translateX(0); }

.thr-menu__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 12px 18px;
    border-bottom: 1px solid rgba(201, 141, 123, 0.22);
}

.thr-menu__title { min-width: 0; }

.thr-menu__title h3 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 800;
    color: #5c4a40;
    letter-spacing: 0.5px;
}

.thr-menu__title small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(92, 74, 64, 0.52);
}

.thr-menu__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    background: rgba(201, 141, 123, 0.14);
    color: #8a6355;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.thr-menu__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 12px;
    scrollbar-width: none;
}

.thr-menu__list::-webkit-scrollbar { display: none; width: 0; height: 0; }

.thr-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 8px;
    padding: 11px 12px 11px 14px;
    border: 1px solid rgba(201, 141, 123, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: #5c4a40;
    text-align: left;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.14s ease, background-color 0.14s ease;
}

.thr-menu__item:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.95); }

.thr-menu__item:disabled {
    opacity: 0.58;
    cursor: default;
}

.thr-menu__item:disabled:active { transform: none; }

/* 锁定项（功能未开发完成）：灰态但仍可点击，点击只弹提示不进入 */
.thr-menu__item--locked {
    opacity: 0.62;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.55);
    cursor: not-allowed;
}

.thr-menu__item--locked:active { transform: none; background: rgba(255, 255, 255, 0.55); }

.thr-menu__item--locked .thr-menu__chev { opacity: 0.35; }

.thr-menu__tag {
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(92, 74, 64, 0.12);
    color: rgba(92, 74, 64, 0.72);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.thr-menu__item--primary {
    border-color: transparent;
    background: linear-gradient(135deg, #d89a86 0%, #c07b66 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(192, 123, 102, 0.3);
}

.thr-menu__item--primary:active { background: linear-gradient(135deg, #cf8f7a 0%, #b7715c 100%); }

.thr-menu__item--danger {
    border-color: rgba(190, 102, 77, 0.45);
    color: #a4513e;
}

.thr-menu__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.thr-menu__text b {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.thr-menu__text small {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(92, 74, 64, 0.6);
}

.thr-menu__item--primary .thr-menu__text small { color: rgba(255, 255, 255, 0.8); }
.thr-menu__item--danger .thr-menu__text small { color: rgba(164, 81, 62, 0.7); }

.thr-menu__badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #c07b66;
    color: #fff;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(192, 123, 102, 0.35);
}

.thr-menu__item--primary .thr-menu__badge { background: rgba(255, 255, 255, 0.92); color: #b7715c; }

.thr-menu__chev {
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: rgba(92, 74, 64, 0.35);
}

.thr-menu__item--primary .thr-menu__chev { color: rgba(255, 255, 255, 0.75); }

.thr-menu__sep {
    height: 1px;
    margin: 4px 6px 12px;
    background: rgba(201, 141, 123, 0.22);
}

.thr-menu__foot {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 16px 0;
    text-align: center;
    font-size: 10.5px;
    color: rgba(92, 74, 64, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .thr-menu,
    .thr-menu-mask,
    .thr-more-btn,
    .thr-more-btn__dots i,
    .thr-menu__item { transition: none; }
    .thr-more-btn.is-busy .thr-more-btn__dots i { animation: none; opacity: 0.6; }
}

/* ============================ 房间 · 装修备忘录（微信聊天联动） ============================ */

.thr-memo-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #c07b66;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(192, 123, 102, 0.4);
    pointer-events: none;
}

.thr-memo-sec {
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: #6d564a;
}

.thr-memo-sec:first-child { margin-top: 2px; }

.thr-memo-sec small {
    margin-left: 6px;
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(109, 86, 74, 0.55);
}

.thr-memo-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 10px;
    margin-bottom: 7px;
    border: 1px solid rgba(201, 141, 123, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
}

.thr-memo-item__main { flex: 1; min-width: 0; }

.thr-memo-item__main p {
    margin: 0 0 3px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #4d3d34;
    word-break: break-all;
}

.thr-memo-item__main small {
    font-size: 10.5px;
    color: rgba(109, 86, 74, 0.55);
}

.thr-memo-item__del {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 8px;
    background: rgba(201, 141, 123, 0.14);
    color: #a3766a;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.thr-memo-item__del:active { transform: scale(0.9); }

.thr-memo-empty {
    padding: 26px 14px;
    border: 1.5px dashed rgba(201, 141, 123, 0.35);
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(109, 86, 74, 0.6);
    text-align: center;
}

html[data-appearance="dark"] .thr-more-btn {
    background: rgba(58, 47, 40, 0.85);
    color: #e0cfc2;
    box-shadow: none;
}

html[data-appearance="dark"] .thr-more-btn.is-active {
    background: linear-gradient(135deg, #b0705a 0%, #8f523f 100%);
    color: #fff;
}

html[data-appearance="dark"] .thr-menu-mask { background: rgba(0, 0, 0, 0.5); }

html[data-appearance="dark"] .thr-menu {
    background:
        radial-gradient(circle at 90% 6%, rgba(154, 106, 90, 0.22), transparent 46%),
        linear-gradient(180deg, #241d18 0%, #1a1411 100%);
    border-left-color: rgba(201, 141, 123, 0.22);
    box-shadow: -18px 0 44px rgba(0, 0, 0, 0.45);
}

html[data-appearance="dark"] .thr-menu__head { border-bottom-color: rgba(201, 141, 123, 0.18); }
html[data-appearance="dark"] .thr-menu__title h3 { color: #f0e4da; }
html[data-appearance="dark"] .thr-menu__title small,
html[data-appearance="dark"] .thr-menu__foot { color: rgba(224, 207, 194, 0.45); }

html[data-appearance="dark"] .thr-menu__close {
    background: rgba(201, 141, 123, 0.18);
    color: #e0cfc2;
}

html[data-appearance="dark"] .thr-menu__item {
    background: rgba(48, 39, 33, 0.75);
    border-color: rgba(201, 141, 123, 0.2);
    color: #f0e4da;
}

html[data-appearance="dark"] .thr-menu__item:active { background: rgba(58, 47, 40, 0.95); }
html[data-appearance="dark"] .thr-menu__text small { color: rgba(224, 207, 194, 0.5); }
html[data-appearance="dark"] .thr-menu__chev { color: rgba(224, 207, 194, 0.35); }
html[data-appearance="dark"] .thr-menu__sep { background: rgba(201, 141, 123, 0.18); }

html[data-appearance="dark"] .thr-menu__item--primary {
    background: linear-gradient(135deg, #b0705a 0%, #8f523f 100%);
    border-color: transparent;
    color: #fff;
}

html[data-appearance="dark"] .thr-menu__item--primary:active { background: linear-gradient(135deg, #a26652 0%, #824a39 100%); }
html[data-appearance="dark"] .thr-menu__item--primary .thr-menu__text small { color: rgba(255, 255, 255, 0.78); }

html[data-appearance="dark"] .thr-menu__item--danger {
    border-color: rgba(214, 128, 104, 0.45);
    color: #e79a82;
}

html[data-appearance="dark"] .thr-menu__item--danger .thr-menu__text small { color: rgba(231, 154, 130, 0.7); }

html[data-appearance="dark"] .thr-memo-sec { color: #e0cfc2; }
html[data-appearance="dark"] .thr-memo-sec small { color: rgba(224, 207, 194, 0.45); }

html[data-appearance="dark"] .thr-memo-item {
    background: rgba(48, 39, 33, 0.7);
    border-color: rgba(201, 141, 123, 0.2);
}

html[data-appearance="dark"] .thr-memo-item__main p { color: #f0e4da; }
html[data-appearance="dark"] .thr-memo-item__main small { color: rgba(224, 207, 194, 0.45); }

html[data-appearance="dark"] .thr-memo-item__del {
    background: rgba(201, 141, 123, 0.18);
    color: #e0cfc2;
}

html[data-appearance="dark"] .thr-memo-empty {
    border-color: rgba(201, 141, 123, 0.28);
    color: rgba(224, 207, 194, 0.55);
}

/* ============================ 物品名片 ============================ */

.th-modal--card { max-width: 340px; }

.th-modal--card .th-modal__foot { padding-top: 12px; }
.thr-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.thr-card-actions .th-btn { min-height: 40px; }
.thr-card-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.thr-card-editor__field { display: block; min-width: 0; }
.thr-card-editor__field > span {
    display: flex; justify-content: space-between; gap: 8px;
    margin-bottom: 5px; color: #6d564a; font-size: 12px; font-weight: 700;
}
.thr-card-editor__field small { color: #9d8578; font-size: 11px; font-weight: 400; }
.thr-card-editor__field .th-input { box-sizing: border-box; width: 100%; min-width: 0; }
.thr-card-editor__field textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.thr-card-editor__status { margin: 0 0 8px; font-size: 12px; line-height: 1.5; color: #a15f50; }
.thr-card-editor__status:empty { display: none; }
[data-thr-card-discard] { margin-bottom: 12px; padding: 10px; border-radius: 10px; background: rgba(201, 141, 123, .12); }
[data-thr-card-discard] p { margin: 0 0 8px; color: #6d564a; font-size: 12px; line-height: 1.5; }
.th-modal--card-editor input, .th-modal--card-editor textarea { font-size: 16px; }
.th-modal--card-editor button:disabled { opacity: .6; cursor: wait; }

@media (max-height: 480px) {
    .th-modal-mask:has(.th-modal--card) { padding-block: 8px; }
    .th-modal--card { max-height: 96%; }
}

.thr-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.thr-card__media {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid rgba(201, 141, 123, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.thr-card__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thr-card__main { flex: 1; min-width: 0; }

.thr-card__main h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 800;
    color: #5c4a40;
    word-break: break-all;
}

.thr-card-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.thr-card-row span {
    flex: 0 0 4em;
    white-space: nowrap;
    color: rgba(109, 86, 74, 0.6);
}

.thr-card-row b {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #5c4a40;
    word-break: break-all;
}

.thr-card-story {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 12px;
    background: rgba(201, 141, 123, 0.1);
}

/* 通栏版想法/心情：置于图文行下方占满整行（左侧不再留缩略图宽度的空白） */
.thr-card-story--full {
    margin-top: 12px;
    padding: 10px 12px;
}

.thr-card-story h5 {
    margin: 0 0 5px;
    font-size: 11.5px;
    font-weight: 800;
    color: #a3766a;
}

.thr-card-story p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.75;
    color: #4d3d34;
    white-space: pre-wrap;
    word-break: break-word;
}

.thr-card-loading {
    padding: 14px 4px;
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(109, 86, 74, 0.7);
}

.thr-card-loading small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(109, 86, 74, 0.5);
}

.thr-card-loading--err { color: #b5695a; }

.thr-card-book {
    margin-top: 14px;
    padding: 11px 12px;
    border: 1px dashed rgba(201, 141, 123, 0.4);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.6);
}

.thr-card-book h5 {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: #a3766a;
}

.thr-card-book__title {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 700;
    color: #5c4a40;
}

.thr-card-book__title small {
    font-size: 11px;
    font-weight: 500;
    color: rgba(109, 86, 74, 0.55);
}

.thr-card-book__note {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    color: #6d564a;
}

.thr-card-book__more {
    margin: 6px 0 0;
    font-size: 11px;
    color: rgba(109, 86, 74, 0.5);
}

.thr-card-book--empty {
    font-size: 11.5px;
    line-height: 1.65;
    color: rgba(109, 86, 74, 0.55);
}

/* 礼物备忘条目 */
.thr-memo-item.is-gift { border-color: rgba(201, 141, 123, 0.5); }

.thr-memo-gift {
    display: inline-block;
    margin-right: 5px;
    padding: 1px 6px;
    border-radius: 6px;
    background: #c07b66;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    vertical-align: 1px;
}

.thr-memo-mood {
    margin: 6px 0 0;
    padding: 7px 9px;
    border-left: 2px solid rgba(201, 141, 123, 0.5);
    border-radius: 0 8px 8px 0;
    background: rgba(201, 141, 123, 0.09);
    font-size: 12px;
    line-height: 1.7;
    color: #6d564a;
    white-space: pre-wrap;
}

.thr-memo-item__btns {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

html[data-appearance="dark"] .thr-card__media {
    background: rgba(48, 39, 33, 0.7);
    border-color: rgba(201, 141, 123, 0.22);
}

html[data-appearance="dark"] .thr-card__main h4,
html[data-appearance="dark"] .thr-card-row b,
html[data-appearance="dark"] .thr-card-book__title { color: #f0e4da; }

html[data-appearance="dark"] .thr-card-row span,
html[data-appearance="dark"] .thr-card-loading,
html[data-appearance="dark"] .thr-card-book__note,
html[data-appearance="dark"] .thr-memo-mood { color: rgba(224, 207, 194, 0.6); }

html[data-appearance="dark"] .thr-card-story { background: rgba(201, 141, 123, 0.16); }
html[data-appearance="dark"] .thr-card-story p { color: #e8dbd0; }

html[data-appearance="dark"] .thr-card-book {
    background: rgba(48, 39, 33, 0.55);
    border-color: rgba(201, 141, 123, 0.3);
}

/* 不支持 backdrop-filter 的内核：改用更实的底色，避免文字浮在花底上 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .th-head { background: rgba(250, 245, 238, 0.98); }
    .th-home-card { background: rgba(255, 255, 255, 0.95); }
    .thr-ai-panel { background: rgba(253, 249, 243, 0.99); }
    html[data-appearance="dark"] .th-head { background: rgba(34, 27, 22, 0.98); }
    html[data-appearance="dark"] .th-home-card { background: rgba(48, 39, 33, 0.96); }
    html[data-appearance="dark"] .thr-ai-panel { background: rgba(38, 31, 26, 0.99); }
}

/* 不支持 aspect-ratio 的旧内核：仓库缩略图用 padding 撑出正方形 */
@supports not (aspect-ratio: 4 / 3) {
    .th-wh-item__img { height: 0; padding-bottom: 100%; position: relative; }
    .th-wh-item__img img { position: absolute; inset: 0; }
}

/* ============================ 访客登记 / 留言板（tiny-home-guestbook.js） ============================ */

/* 公寓详情页：访客登记 / 留言板 双按钮行（在「退租 / 拆除」上方） */
.th-apt-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 8px;
}

.th-apt-tool {
    width: 100%;
    padding: 10px 0;
    font-weight: 700;
}

/* 弹层宿主：与仓库同级的独立浮层 */
.th-guest-host {
    position: absolute;
    inset: 0;
    z-index: 2712;
}

.th-guest-host .th-modal-mask { position: absolute; }

.th-guest-modal { max-width: 360px; }

.th-guest-tip {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(201, 141, 123, 0.1);
    color: #8a6355;
    font-size: 11.5px;
    line-height: 1.6;
}

.th-guest-empty {
    padding: 26px 8px;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(92, 74, 64, 0.55);
}

/* 访客登记内的分节标题（访客设置 / 到访实录） */
.th-guest-sec {
    margin: 4px 0 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #7a5c4e;
    letter-spacing: 0.5px;
}

.th-guest-sec + .th-guest-sec,
.th-visit-set + .th-guest-sec,
.th-visit-fold + .th-guest-sec {
    margin-top: 16px;
}

/* 访客设置折叠段：点标题展开；名单区约两行 Char 高，可上下滚动（滚动条隐藏） */
.th-visit-fold {
    margin: 4px 0 8px;
}

.th-visit-fold__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #7a5c4e;
    letter-spacing: 0.5px;
    cursor: pointer;
    list-style: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.th-visit-fold__head::-webkit-details-marker {
    display: none;
}

.th-visit-fold__caret {
    font-size: 11px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.th-visit-fold[open] .th-visit-fold__caret {
    transform: rotate(180deg);
}

.th-visit-fold__list {
    max-height: 218px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.th-visit-fold__list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* 访客设置 · 单个 Char 的授权行 */
.th-visit-set {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(201, 141, 123, 0.2);
}

.th-visit-set__name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #5c4a40;
    cursor: pointer;
}

.th-visit-set__name input[type="checkbox"] {
    accent-color: #c98d7b;
}

.th-visit-set__opts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    font-size: 12px;
    color: #7a6558;
}

.th-visit-set__sep {
    margin: 0 4px;
    opacity: 0.5;
}

.th-visit-set__num {
    width: 46px;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(201, 141, 123, 0.35);
    background: rgba(255, 255, 255, 0.9);
    color: #5c4a40;
    font-size: 12px;
    text-align: center;
}

.th-visit-set__num:disabled {
    opacity: 0.45;
}

.th-visit-set__status {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.55;
    color: rgba(122, 92, 78, 0.75);
}

/* 到访记录条目 */
.th-guest-item {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(201, 141, 123, 0.2);
}

.th-guest-item__head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.th-guest-item__head strong {
    font-size: 13.5px;
    color: #5c4a40;
}

.th-guest-badge {
    padding: 1px 6px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.5;
}

.th-guest-badge--user {
    background: rgba(123, 152, 201, 0.18);
    color: #4f6ea8;
}

.th-guest-badge--char {
    background: rgba(201, 141, 123, 0.2);
    color: #a05f49;
}

.th-guest-del {
    margin-left: auto;
    border: 0;
    background: none;
    color: #b0705a;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    -webkit-tap-highlight-color: transparent;
}

.th-guest-item__time {
    margin-top: 3px;
    font-size: 11px;
    color: rgba(92, 74, 64, 0.5);
}

.th-guest-item__meta {
    margin-top: 2px;
    font-size: 11.5px;
    color: #8a6355;
}

.th-guest-item__summary {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #6d564a;
}

.th-guest-item__rooms,
.th-guest-item__items {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.6;
    color: #6d564a;
}

.th-guest-item__rooms--none { color: rgba(92, 74, 64, 0.45); }

/* 到访 / 留宿 类型角标 */
.th-guest-badge--kind {
    background: rgba(92, 74, 64, 0.08);
    color: rgba(92, 74, 64, 0.6);
}

.th-guest-badge--stay {
    background: rgba(143, 122, 190, 0.18);
    color: #6d5aa8;
}

/* 进行中的到访 / 尚未离开的留宿：左侧一道柔和的呼吸色条 */
.th-guest-item--live {
    border-left: 3px solid rgba(143, 160, 108, 0.75);
}

.th-guest-live {
    font-style: normal;
    color: #7f9a5a;
    font-weight: 700;
}

/* 留宿记录卡：位置 / 实况 / 离去 三行键值 */
.th-guest-item--stay {
    background: rgba(248, 243, 252, 0.92);
    border-color: rgba(143, 122, 190, 0.28);
}

.th-guest-stay__row {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.65;
    color: #5f4d6e;
}

.th-guest-stay__row small {
    color: rgba(95, 77, 110, 0.6);
}

.th-guest-stay__k {
    flex: 0 0 auto;
    padding: 0 6px;
    border-radius: 6px;
    background: rgba(143, 122, 190, 0.14);
    color: #6d5aa8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.9;
    height: 22px;
    white-space: nowrap;
}

.th-guest-stay__detail {
    white-space: pre-wrap;
    word-break: break-word;
}

/* 留言板 */
.th-guest-msg {
    margin-bottom: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 249, 235, 0.92);
    border: 1px solid rgba(201, 141, 123, 0.18);
}

.th-guest-msg__head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.th-guest-msg__head strong {
    font-size: 13px;
    color: #5c4a40;
}

.th-guest-msg__head time {
    font-size: 10.5px;
    color: rgba(92, 74, 64, 0.5);
}

.th-guest-msg__content {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #5f4b40;
    word-break: break-word;
}

/* 户主还没看过的新留言：左侧立一条暖色标记，翻留言板时一眼能找到 */
.th-guest-msg--unread {
    border-color: rgba(201, 141, 123, 0.5);
    box-shadow: inset 3px 0 0 #c98d7b;
}

.th-guest-msg__status {
    margin-top: 5px;
    font-size: 10.5px;
    line-height: 1.5;
    color: rgba(92, 74, 64, 0.5);
}

.th-guest-msg__status--new {
    color: #a05f49;
    font-weight: 800;
}

.th-guest-msg__acts {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
}

.th-guest-msg__relayed {
    font-size: 10.5px;
    color: rgba(92, 74, 64, 0.45);
}

.th-btn--mini {
    padding: 4px 10px;
    border-radius: 9px;
    font-size: 11.5px;
    font-weight: 700;
}

.th-guest-msg-composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid rgba(201, 141, 123, 0.22);
}

.th-guest-msg-composer .th-input { flex: 1; min-width: 0; }

/* 留言可以写到 300 字：输入框随内容长高，但不吃掉整块留言列表 */
.th-guest-msg-input {
    min-height: 34px;
    max-height: 96px;
    resize: none;
    line-height: 1.55;
    field-sizing: content;
}

html[data-appearance="dark"] .th-guest-msg--unread {
    border-color: rgba(201, 141, 123, 0.55);
}

html[data-appearance="dark"] .th-guest-msg__status,
html[data-appearance="dark"] .th-guest-msg__relayed { color: rgba(224, 207, 194, 0.45); }

html[data-appearance="dark"] .th-guest-msg__status--new { color: #e8b7a4; }

/* 暗色模式 */
html[data-appearance="dark"] .th-guest-tip {
    background: rgba(201, 141, 123, 0.14);
    color: #d3bfb2;
}

html[data-appearance="dark"] .th-guest-empty { color: rgba(224, 207, 194, 0.5); }

html[data-appearance="dark"] .th-guest-sec { color: #d8bfae; }

html[data-appearance="dark"] .th-visit-fold__head { color: #d8bfae; }

html[data-appearance="dark"] .th-visit-set {
    background: rgba(46, 38, 34, 0.85);
    border-color: rgba(201, 141, 123, 0.24);
}

html[data-appearance="dark"] .th-visit-set__name { color: #e0cfc2; }

html[data-appearance="dark"] .th-visit-set__opts { color: #c9b4a6; }

html[data-appearance="dark"] .th-visit-set__num {
    background: rgba(30, 25, 22, 0.9);
    border-color: rgba(201, 141, 123, 0.3);
    color: #e0cfc2;
}

html[data-appearance="dark"] .th-visit-set__status { color: rgba(211, 191, 178, 0.6); }

html[data-appearance="dark"] .th-guest-item,
html[data-appearance="dark"] .th-guest-msg {
    background: rgba(48, 39, 33, 0.72);
    border-color: rgba(201, 141, 123, 0.26);
}

html[data-appearance="dark"] .th-guest-item__head strong,
html[data-appearance="dark"] .th-guest-msg__head strong { color: #f0e4da; }

html[data-appearance="dark"] .th-guest-item__meta,
html[data-appearance="dark"] .th-guest-item__rooms,
html[data-appearance="dark"] .th-guest-item__items,
html[data-appearance="dark"] .th-guest-item__summary,
html[data-appearance="dark"] .th-guest-msg__content { color: #d3bfb2; }

html[data-appearance="dark"] .th-guest-item__time,
html[data-appearance="dark"] .th-guest-msg__head time { color: rgba(224, 207, 194, 0.45); }

html[data-appearance="dark"] .th-guest-msg-composer { border-top-color: rgba(201, 141, 123, 0.2); }

html[data-appearance="dark"] .th-guest-item--stay {
    background: rgba(52, 44, 62, 0.78);
    border-color: rgba(163, 142, 210, 0.3);
}

html[data-appearance="dark"] .th-guest-badge--kind {
    background: rgba(224, 207, 194, 0.1);
    color: rgba(224, 207, 194, 0.6);
}

html[data-appearance="dark"] .th-guest-badge--stay,
html[data-appearance="dark"] .th-guest-stay__k {
    background: rgba(163, 142, 210, 0.22);
    color: #cbbcf0;
}

html[data-appearance="dark"] .th-guest-stay__row { color: #ddd2ea; }
html[data-appearance="dark"] .th-guest-stay__row small { color: rgba(221, 210, 234, 0.55); }
html[data-appearance="dark"] .th-guest-item--live { border-left-color: rgba(163, 184, 122, 0.8); }
html[data-appearance="dark"] .th-guest-live { color: #b5cf8a; }

/* ============================ 家具收纳（tiny-home-stash.js） ============================
 * 家具既是陈设也是收纳容器：购物买到 / 收到的物品摆进家具后，在物品名片下方
 * 成列展示（礼物注明赠送者姓名）。
 * 弹窗宿主 .th-stash-host 用 2760：既要盖住房间层(2708)/仓库(2712)/确认(2714)，
 * 也要能从购物背包弹窗(.modal z-index 1000)里直接叫出来。 */

.th-stash-host {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    z-index: 2760;
    pointer-events: none;
}

.th-stash-host:empty { display: none; }

.th-stash-host > .th-modal-mask {
    position: absolute;
    pointer-events: auto;
}

.th-modal--stash { max-width: 340px; }

.th-stash-foot {
    flex: 0 0 auto;
    display: flex;
    gap: 9px;
    padding: 10px 16px calc(14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid rgba(201, 141, 123, 0.22);
}

.th-stash-foot .th-btn { flex: 1; }

/* -------- 名片里的物品清单 -------- */

.th-stash-card {
    margin-top: 14px;
    padding: 11px 12px;
    border: 1px solid rgba(201, 141, 123, 0.34);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.62);
}

.th-stash-card h5 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 800;
    color: #a3766a;
}

.th-stash-card h5 span {
    font-size: 10.5px;
    font-weight: 600;
    color: rgba(109, 86, 74, 0.5);
}

.th-stash-card--empty p {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.65;
    color: rgba(109, 86, 74, 0.55);
}

.th-stash-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.th-stash-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border: 1px solid rgba(201, 141, 123, 0.2);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.78);
}

.th-stash-row.is-gift {
    border-color: rgba(201, 141, 123, 0.46);
    background: rgba(216, 154, 134, 0.11);
}

.th-stash-thumb {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 9px;
    background: rgba(201, 141, 123, 0.1);
}

.th-stash-thumb img,
.th-stash-thumb svg,
.th-stash-thumb > div {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.th-stash-thumb--ph {
    font-size: 12px;
    font-weight: 800;
    color: rgba(163, 118, 106, 0.7);
}

.th-stash-main { flex: 1; min-width: 0; }

.th-stash-name {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #5c4a40;
    word-break: break-all;
}

.th-stash-name em {
    margin-left: 4px;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    color: rgba(109, 86, 74, 0.6);
}

.th-stash-tag {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 6px;
    background: #c07b66;
    color: #fff;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    vertical-align: 1px;
}

.th-stash-main small {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    line-height: 1.5;
    color: rgba(109, 86, 74, 0.62);
}

.th-stash-where { color: rgba(163, 118, 106, 0.75) !important; }

.th-stash-row__btns {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.th-stash-del {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 7px;
    background: rgba(191, 83, 70, 0.12);
    color: #b0574b;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* -------- 放入弹窗 / 收纳面板 -------- */

.th-stash-obj {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(201, 141, 123, 0.1);
}

.th-stash-obj .th-stash-thumb {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
}

.th-stash-obj__main { flex: 1; min-width: 0; }

.th-stash-obj__main p {
    margin: 0;
    font-size: 13.5px;
    font-weight: 800;
    color: #5c4a40;
    word-break: break-all;
}

.th-stash-obj__main small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: rgba(109, 86, 74, 0.6);
}

.th-stash-field {
    display: block;
    margin-bottom: 10px;
}

.th-stash-field > span {
    display: block;
    margin-bottom: 2px;
    font-size: 11.5px;
    font-weight: 700;
    color: #8a6355;
}

.th-stash-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

/* 减 | 数字 | 加 做成一个整体控件，按钮加大到好点的尺寸，与右侧说明文字拉开距离 */
.th-stash-qty__ctrl {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: stretch;
    border: 1px solid rgba(201, 141, 123, 0.4);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    overflow: hidden;
}

.th-stash-qty__btn {
    width: 40px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #8a6355;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.th-stash-qty__btn:active {
    background: rgba(216, 154, 134, 0.18);
}

.th-stash-qty b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0 8px;
    border-left: 1px solid rgba(201, 141, 123, 0.25);
    border-right: 1px solid rgba(201, 141, 123, 0.25);
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: #5c4a40;
}

.th-stash-qty small {
    font-size: 12px;
    color: rgba(109, 86, 74, 0.55);
}

.th-stash-hint {
    margin: 8px 0 0;
    font-size: 11.5px;
    line-height: 1.65;
    color: rgba(109, 86, 74, 0.62);
}

.th-stash-hint--warn {
    padding: 9px 11px;
    border-radius: 11px;
    background: rgba(216, 154, 134, 0.14);
    color: #9c6656;
}

.th-stash-sec {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 14px 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: #8a6355;
}

.th-stash-sec:first-child { margin-top: 2px; }

.th-stash-sec small {
    font-size: 10.5px;
    font-weight: 600;
    color: rgba(109, 86, 74, 0.48);
}

.th-stash-anchor {
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px dashed rgba(201, 141, 123, 0.4);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
}

.th-stash-anchor__name {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 7px;
    font-size: 12.5px;
    font-weight: 800;
    color: #5c4a40;
}

.th-stash-anchor__name em {
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
    color: rgba(109, 86, 74, 0.5);
}

.th-stash-empty {
    padding: 16px 6px;
    font-size: 12px;
    line-height: 1.75;
    color: rgba(109, 86, 74, 0.6);
}

/* -------- 暗色模式 -------- */

html[data-appearance="dark"] .th-stash-card,
html[data-appearance="dark"] .th-stash-anchor {
    background: rgba(48, 39, 33, 0.62);
    border-color: rgba(201, 141, 123, 0.28);
}

html[data-appearance="dark"] .th-stash-row {
    background: rgba(56, 46, 39, 0.8);
    border-color: rgba(201, 141, 123, 0.24);
}

html[data-appearance="dark"] .th-stash-row.is-gift { background: rgba(154, 106, 90, 0.28); }

html[data-appearance="dark"] .th-stash-name,
html[data-appearance="dark"] .th-stash-anchor__name,
html[data-appearance="dark"] .th-stash-obj__main p,
html[data-appearance="dark"] .th-stash-qty b { color: #f0e4da; }

html[data-appearance="dark"] .th-stash-qty__ctrl {
    background: rgba(58, 47, 40, 0.85);
    border-color: rgba(201, 141, 123, 0.3);
}

html[data-appearance="dark"] .th-stash-qty__btn { color: #e0cfc2; }

html[data-appearance="dark"] .th-stash-qty__btn:active { background: rgba(216, 154, 134, 0.16); }

html[data-appearance="dark"] .th-stash-qty b {
    border-left-color: rgba(201, 141, 123, 0.22);
    border-right-color: rgba(201, 141, 123, 0.22);
}

html[data-appearance="dark"] .th-stash-main small,
html[data-appearance="dark"] .th-stash-obj__main small,
html[data-appearance="dark"] .th-stash-hint,
html[data-appearance="dark"] .th-stash-empty,
html[data-appearance="dark"] .th-stash-card--empty p { color: rgba(211, 191, 178, 0.7); }

html[data-appearance="dark"] .th-stash-obj { background: rgba(154, 106, 90, 0.22); }

html[data-appearance="dark"] .th-stash-foot { border-top-color: rgba(201, 141, 123, 0.2); }


/* ============================ 户型区域：并入提示 / 区域校正面板 ============================
   tiny-home-plan-regions.js 的区域校正面板挂在 #app 下：高于仓库（2712），低于确认弹窗（2714），
   放弃修改的确认框能盖在面板上。 */

.th-artplan__chip--edit {
    border-style: dashed;
    color: #a0634d;
}

.th-plan-merge {
    margin: 8px 2px 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(252, 239, 228, 0.9);
    border: 1px solid rgba(201, 141, 123, 0.35);
    font-size: 12px;
    line-height: 1.6;
    color: #7a5646;
}

.th-plan-merge__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.th-plan-merge__row + .th-plan-merge__row { margin-top: 6px; }
.th-plan-merge__row span { flex: 1 1 180px; min-width: 0; }

.th-region-editor {
    position: absolute;
    inset: 0;
    z-index: 2713;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(40, 30, 25, 0.55);
}

.th-region-editor__panel {
    display: flex;
    flex-direction: column;
    width: min(100%, 560px);
    max-height: 100%;
    background: #fffaf3;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 28px rgba(73, 52, 43, 0.2);
    overflow: hidden;
    padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

.th-region-editor__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(201, 141, 123, 0.2);
    flex: none;
}

.th-region-editor__head h3 { margin: 0; font-size: 16px; color: #5c4a40; }
.th-region-editor__head small { display: block; margin-top: 2px; font-size: 11px; color: rgba(92, 74, 64, 0.6); }

.th-region-editor__close {
    flex: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(201, 141, 123, 0.14);
    color: #6d564a;
    font-size: 20px;
    cursor: pointer;
}

.th-region-editor__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 10px 14px 6px;
    overscroll-behavior: contain;
}

.th-region-editor__stage {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f3ece4;
    user-select: none;
    -webkit-user-select: none;
}

.th-region-editor__ratio { display: block; width: 100%; height: 0; }

.th-region-editor__img,
.th-region-editor__layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.th-region-editor__img { display: block; object-fit: fill; pointer-events: none; }

.th-re-box {
    position: absolute;
    box-sizing: border-box;
    border: 1.5px dashed rgba(92, 74, 64, 0.55);
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    cursor: pointer;
    touch-action: none;
}

.th-re-box.is-selected {
    border: 2px solid rgba(192, 103, 78, 0.95);
    background: rgba(216, 154, 134, 0.26);
    z-index: 2;
    cursor: move;
}

.th-re-box.is-active { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); z-index: 3; }
.th-re-box:focus-visible { outline: 3px solid #a27552; outline-offset: 1px; }

.th-re-box__tag {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 96%;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: #5c4a40;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.th-re-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: #fffaf3;
    border: 2px solid rgba(192, 103, 78, 0.95);
    box-shadow: 0 1px 4px rgba(73, 52, 43, 0.25);
    touch-action: none;
}

.th-re-handle--nw { left: 0; top: 0; cursor: nwse-resize; }
.th-re-handle--ne { left: 100%; top: 0; cursor: nesw-resize; }
.th-re-handle--sw { left: 0; top: 100%; cursor: nesw-resize; }
.th-re-handle--se { left: 100%; top: 100%; cursor: nwse-resize; }

.th-region-editor__rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 6px;
}

.th-re-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-height: 36px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(201, 141, 123, 0.4);
    background: #fff;
    color: #6d564a;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.th-re-chip small { font-size: 10.5px; font-weight: 500; color: rgba(92, 74, 64, 0.55); }
.th-re-chip.is-selected { background: #c9826c; border-color: #c9826c; color: #fff; }
.th-re-chip.is-selected small { color: rgba(255, 255, 255, 0.85); }
.th-re-chip.is-missing:not(.is-selected) { border-style: dashed; }

.th-region-editor__tools { display: flex; flex-wrap: wrap; gap: 6px; }

.th-region-editor__note,
.th-region-editor__status {
    margin: 8px 2px 0;
    font-size: 11.5px;
    line-height: 1.65;
    color: rgba(92, 74, 64, 0.62);
}

.th-region-editor__status { color: #9b5a43; }
.th-region-editor__status[hidden] { display: none; }

.th-region-editor__foot {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(201, 141, 123, 0.2);
    flex: none;
}

.th-region-editor__foot .th-btn { min-height: 42px; }

html[data-appearance="dark"] .th-plan-merge { background: rgba(70, 50, 42, 0.85); color: #e6d6c8; border-color: rgba(201, 141, 123, 0.3); }
html[data-appearance="dark"] .th-region-editor__panel { background: #2e2621; }
html[data-appearance="dark"] .th-region-editor__head h3,
html[data-appearance="dark"] .th-re-chip { color: #e6d6c8; }
html[data-appearance="dark"] .th-re-chip { background: rgba(58, 47, 40, 0.95); }
html[data-appearance="dark"] .th-re-chip.is-selected { background: #b8735d; color: #fff; }
html[data-appearance="dark"] .th-region-editor__note { color: rgba(224, 207, 194, 0.6); }
html[data-appearance="dark"] .th-region-editor__close { color: #e6d6c8; }
.th-yard-entries { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* New ground-floor garden choice; native controls retain keyboard support. */
.th-garden-choice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(201,141,123,.3); border-radius: 14px; background: #f8f2eb; }
.th-garden-check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: #6f5546; font-weight: 600; cursor: pointer; }
.th-garden-check input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: #496f7c; }
.th-garden-check input:focus-visible, #th-wiz-garden-style:focus-visible { outline: 2px solid #496f7c; outline-offset: 3px; }
.th-garden-select-label { display: block; margin: 4px 0 8px; font-size: 12px; color: #806c5e; }
#th-wiz-garden-style { width: 100%; min-height: 44px; }
.th-garden-choice .th-wiz-note { margin: 10px 0 0; line-height: 1.65; }
.th-garden-choice [hidden] { display: none !important; }
.th-garden-address-note { line-height: 1.65; }
.th-garden-entry-note { align-self: center; font-size: 11px; line-height: 1.6; color: #8a786b; }
.th-plan-garden { cursor: pointer; outline: none; }
.th-plan-garden rect { fill: #e3ecdc; fill-opacity: .72; stroke: #789071; stroke-width: .5; }
.th-plan-garden text { font-size: 4px; fill: #496040; pointer-events: none; }
.th-artplan__overlay .th-plan-garden rect { fill-opacity: .08; stroke-dasharray: 1.2 1; }
.th-plan-garden:hover rect, .th-plan-garden:focus-visible rect { fill-opacity: .35; stroke-width: 1; }
.th-artplan__garden-controls { position: absolute; z-index: 4; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 2px; }
.th-artplan__garden-controls--portal { top: 8px; left: 50%; transform: translateX(-50%); }
.th-artplan__garden-tag, .th-artplan__garden-adjust { border: 1px solid #8a9c7d; border-radius: 7px; background: #edf2e8; color: #425838; font: inherit; line-height: 1.2; cursor: pointer; min-height: 32px; padding: 7px 10px; white-space: nowrap; }
.th-artplan__garden-adjust { min-height: 32px; padding: 7px; font-size: 10px; }
.th-artplan__garden-tag { font-size: 12px; }
.th-artplan__garden-tag:focus-visible, .th-artplan__garden-adjust:focus-visible { outline: 2px solid #496f7c; outline-offset: 2px; }
.th-garden-transfer { position: fixed; inset: 0; z-index: 2147480000; display: grid; place-items: center; background: #f5f0e8; color: #655746; font-size: 14px; padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom); }
html[data-appearance="dark"] .th-artplan__garden-tag, html[data-appearance="dark"] .th-artplan__garden-adjust { background: #303a2b; color: #e2ecd9; border-color: #718464; }
html[data-appearance="dark"] .th-garden-transfer { background: #28251f; color: #e4dacb; }
html[data-appearance="dark"] .th-garden-choice { background: #302922; border-color: #5d4d41; }
html[data-appearance="dark"] .th-garden-check { color: #ebdbcc; }
html[data-appearance="dark"] .th-garden-select-label, html[data-appearance="dark"] .th-garden-entry-note { color: #c9b7a7; }
