/* Balcony/terrace interface. Legacy selectors preserve existing themes and integrations. */
.thcy-wizard-preview { display:block; width:100%; max-height:60vh; object-fit:contain; }
.thcy-root {
    --thcy-surface: var(--lmg-sub-bg, var(--th-wh-surface, var(--th-cream, #fdf9f3)));
    --thcy-card: var(--lmg-sub-component-bg, var(--th-wh-card, #fff));
    --thcy-ink: var(--lmg-text, var(--th-wh-ink, var(--th-ink, #5c4a40)));
    --thcy-muted: var(--lmg-text, var(--th-wh-muted, #806b5d));
    --thcy-line: var(--lmg-border, var(--th-wh-line, #d8c5b5));
    --thcy-selected: var(--lmg-active-bg, var(--th-wh-selected, #eee0d4));
    --thcy-focus: var(--lmg-text, var(--th-wh-focus, #8a6355));
    position: absolute; inset: 0; z-index: 2709; overflow: hidden;
    display: flex; flex-direction: column; color: var(--thcy-ink);
    background: var(--thcy-surface); font-family: inherit;
}
.thcy-root *, .thcy-root *::before, .thcy-root *::after { box-sizing: border-box; }
.thcy-root [hidden] { display: none !important; }
.thcy-root button {
    min-width: 44px; min-height: 44px; border: 1px solid var(--thcy-line);
    border-radius: 12px; background: var(--thcy-card); color: var(--thcy-ink);
    font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.thcy-root button:focus-visible, .thcy-stage:focus-visible { outline: 3px solid var(--thcy-focus); outline-offset: -3px; }
.thcy-root select:focus-visible { outline: 3px solid var(--thcy-focus); outline-offset: 2px; }
.thcy-root button:active:not(:disabled) { background: var(--thcy-selected); }
.thcy-root button:disabled { opacity: .45; cursor: default; }
.thcy-root button.is-selected { border-color: var(--thcy-focus); background: var(--thcy-selected); }
.thcy-root .thcy-head {
    position: relative; z-index: 5; grid-template-columns: 44px minmax(0,1fr) 58px;
    flex: 0 0 auto; 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)));
    background: var(--thcy-surface); backdrop-filter: none; -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--thcy-line); box-shadow: none;
}
.thcy-head h2 { color: var(--thcy-ink); font-size: 17px; }
.thcy-head .th-back { width: 44px; height: 44px; padding: 0; font-size: 30px; box-shadow: none; }
.thcy-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
.thcy-stage:active { cursor: grabbing; }
.thcy-art { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: none; }
.thcy-picture { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.thcy-foreground, .thcy-foreground-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.thcy-actor { position:absolute; pointer-events:none; image-rendering:auto; transform-origin:center; }
.thcy-weather-canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:2; }
.thcy-root .thm-root { color:var(--thcy-ink); }
.thcy-root .thm-panel,.thcy-root .thm-head,.thcy-root .thm-tab { background:var(--thcy-card); border-color:var(--thcy-line); box-shadow:none; }
.thcy-root .thm-composer textarea,.thcy-root .thm-bubble { background:var(--thcy-surface); color:var(--thcy-ink); border-color:var(--thcy-line); }
.thcy-root .thm-message.is-user .thm-bubble { background:var(--thcy-selected); }
.thcy-marker { position: absolute; z-index: 4; width: 16px; height: 16px; border: 2px solid var(--thcy-card); background: rgba(255,255,255,.28); box-shadow: 0 0 0 1.5px var(--thcy-focus), 0 1px 4px rgba(0,0,0,.2); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.thcy-marker::after { content: ''; position: absolute; inset: -6px; border: 1.5px solid var(--thcy-focus); border-radius: 50%; opacity: 0; animation: thcy-marker-pulse 1.8s ease-out infinite; }
@keyframes thcy-marker-pulse { 0% { transform: scale(.55); opacity: .7; } 70%, 100% { transform: scale(1.15); opacity: 0; } }
/* Compact object menu beside the ring; positioned by script away from people and fixed controls. */
.thcy-actions {
    position: absolute; left: 0; top: 0; z-index: 30; display: flex; flex-direction: column; gap: 4px;
    min-width: 104px; max-width: min(180px, calc(100% - 16px)); padding: 6px; border: 1px solid var(--thcy-line); border-radius: 14px;
    background: var(--thcy-card); color: var(--thcy-ink); box-shadow: 0 6px 18px rgba(40,32,24,.16); animation: thcy-actions-in .14s ease-out;
}
.thcy-actions.is-measuring, .thcy-actions.is-offscreen { visibility: hidden; animation: none; }
.thcy-actions[data-placement^="right"] { transform-origin: left center; }
.thcy-actions[data-placement^="left"] { transform-origin: right center; }
.thcy-actions[data-placement="above"] { transform-origin: center bottom; }
.thcy-actions[data-placement="below"] { transform-origin: center top; }
@keyframes thcy-actions-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.thcy-actions-title { margin: 0; padding: 1px 6px 2px; font-size: 11px; line-height: 1.4; color: var(--thcy-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thcy-root .thcy-actions-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; min-height: 40px; padding: 6px 12px; border-radius: 10px; text-align: left; line-height: 1.3; white-space: nowrap; }
.thcy-actions-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.thcy-actions-item small { flex: none; font-size: 10px; font-weight: 400; color: var(--thcy-muted); }
.thcy-root .thcy-actions-item.is-disabled { opacity: .5; cursor: default; }
.thcy-root .thcy-actions-item.is-current { border-color: var(--thcy-focus); background: var(--thcy-selected); }
.thcy-actions-item.is-current:not(.is-disabled)::after { content: '当前'; font-size: 10px; font-weight: 400; color: var(--thcy-muted); }
.thcy-slot-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--thcy-focus); }
.thcy-slot-outline polygon { fill: none; stroke: currentColor; stroke-width: 2px; stroke-dasharray: 8 5; vector-effect: non-scaling-stroke; }
.thcy-original-picture { display: block; width: 100%; height: auto; max-height: 55vh; object-fit: contain; }
.thcy-weather {
    position: absolute; left: max(12px,var(--safe-area-inset-left,env(safe-area-inset-left,0px)));
    top: calc(72px + var(--safe-area-inset-top,env(safe-area-inset-top,0px)));
    max-width: calc(100% - 92px - var(--safe-area-inset-left,env(safe-area-inset-left,0px)) - var(--safe-area-inset-right,env(safe-area-inset-right,0px)));
    background: var(--thcy-card); border: 1px solid var(--thcy-line); border-radius: 10px;
    padding: 6px 9px; font-size: 11px; line-height: 1.4; z-index: 2;
    display:flex;align-items:center;gap:8px;min-height:44px;color:var(--thcy-ink);text-align:left;
}
.thcy-weather[hidden]{display:none}.thcy-weather-time{flex:none;font-variant-numeric:tabular-nums;font-weight:600}
.thcy-weather-ticker{display:grid;min-width:0;width:160px;height:18px;overflow:hidden;border-left:1px solid var(--thcy-line);padding-left:8px}
.thcy-weather-ticker>span{grid-area:1/1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;animation:thcy-weather-date 18s ease-in-out infinite}
.thcy-weather-ticker>.thcy-weather-location{animation-name:thcy-weather-location}.thcy-weather-ticker>.thcy-weather-condition{animation-name:thcy-weather-condition}
@keyframes thcy-weather-date{0%,27%{transform:translateY(0);opacity:1}33%,94%{transform:translateY(-100%);opacity:0}95%{transform:translateY(100%);opacity:0}100%{transform:translateY(0);opacity:1}}
@keyframes thcy-weather-location{0%,27%{transform:translateY(100%);opacity:0}33%,60%{transform:translateY(0);opacity:1}66%,100%{transform:translateY(-100%);opacity:0}}
@keyframes thcy-weather-condition{0%,60%{transform:translateY(100%);opacity:0}66%,94%{transform:translateY(0);opacity:1}100%{transform:translateY(-100%);opacity:0}}
.thcy-weather:hover .thcy-weather-ticker>span,.thcy-weather:focus-visible .thcy-weather-ticker>span,.thcy-root.is-background .thcy-weather-ticker>span{animation-play-state:paused}
.thcy-weather:focus-visible{outline:2px solid var(--thcy-focus);outline-offset:2px}
.thcy-controls {
    position: absolute; right: max(10px,var(--safe-area-inset-right,env(safe-area-inset-right,0px)));
    top: calc(114px + var(--safe-area-inset-top,env(safe-area-inset-top,0px)));
    display: grid; grid-template-columns: repeat(2,48px); align-items: stretch; gap: 6px;
    width: 102px; max-width: calc(100% - 24px); overflow: visible; z-index: 3;
}
.thcy-controls button { min-width:0; min-height:44px; padding: 6px 2px; border-radius: 10px; }
.thcy-controls [data-thcy-action="people"] { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.thcy-controls.is-collapsed > :not([data-thcy-action="rail"]):not([data-thcy-action="cancel-motion"]) { display:none; }
.thcy-controls.is-collapsed { width:48px; grid-template-columns:48px; }
.thcy-controls [data-thcy-action="rail"] { grid-column:1 / -1; }
.thcy-controls button[data-thcy-action="in"],.thcy-controls button[data-thcy-action="out"] { font-size: 23px; font-weight: 400; }
.thcy-zoom { grid-column:1 / -1; grid-row:4; font-size: 10px; text-align: center; padding: 4px 0; background: var(--thcy-card); border-radius: 6px; }
.thcy-status {
    position: absolute; left: max(12px,var(--safe-area-inset-left,env(safe-area-inset-left,0px)));
    right: max(12px,var(--safe-area-inset-right,env(safe-area-inset-right,0px)));
    bottom: calc(8px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));
    margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--thcy-line);
    font-size: 11px; line-height: 1.5; background: var(--thcy-card); pointer-events: none; z-index: 3;
}
.thcy-load { position: absolute; top: 45%; left: 16px; right: 16px; margin: auto; padding: 20px; max-width: 340px; text-align: center; background: var(--thcy-card); border: 1px solid var(--thcy-line); border-radius: 16px; font-size: 14px; line-height: 1.6; z-index: 4; }
.thcy-load p { margin: 0 0 14px; }
.thcy-sheet {
    position: absolute; z-index: 40; bottom: 0; left: 0; right: 0;
    max-height: calc(100% - 82px - var(--safe-area-inset-top,env(safe-area-inset-top,0px)));
    overflow-y: auto; overscroll-behavior: contain; background: var(--thcy-surface);
    border-top: 1px solid var(--thcy-line); border-radius: 20px 20px 0 0;
    padding: 14px max(16px,var(--safe-area-inset-right,env(safe-area-inset-right,0px))) calc(16px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px))) max(16px,var(--safe-area-inset-left,env(safe-area-inset-left,0px)));
}
.thcy-sheet-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.thcy-sheet h3 { font-size: 19px; margin: 0; }
.thcy-sheet h4 { font-size: 14px; margin: 22px 0 8px; }
.thcy-sheet > button { display: block; width: 100%; margin-top: 8px; text-align: left; }
.thcy-sheet-note { color: var(--thcy-muted); font-size: 12px; line-height: 1.65; margin: 14px 0; }
.thcy-atmosphere-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:12px 0; }
.thcy-atmosphere-field { display:flex; flex-direction:column; gap:8px; font-size:12px; }
.thcy-atmosphere-field select { width:100%; min-width:0; min-height:44px; padding:8px; border:1px solid var(--thcy-line); border-radius:8px; background:var(--thcy-card); color:var(--thcy-ink); font:inherit; font-size:14px; }
.thcy-entity-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.thcy-entity-list button { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-height: 60px; }
.thcy-entity-list span { font-size: 10px; color: var(--thcy-muted); font-weight: 400; }
.thcy-facts { display: grid; grid-template-columns: 70px minmax(0,1fr); font-size: 12px; line-height: 1.6; gap: 8px; }
.thcy-facts dt { color: var(--thcy-muted); }.thcy-facts dd { margin: 0; }
body.tiny-home-courtyard-open .main-float-root,body.tiny-home-courtyard-open .main-float-root * { visibility: hidden !important; pointer-events: none !important; }
@media (hover:hover) { .thcy-root button:hover:not(:disabled) { background: var(--thcy-selected); } }
@media (max-height:480px) {
    .thcy-controls { top: calc(80px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))); width:auto; grid-template-columns:repeat(5,44px); max-width:calc(100% - 28px); gap:5px; }
    .thcy-controls button { width:44px; }.thcy-controls .thcy-zoom { display:none; }
    .thcy-controls [data-thcy-action="rail"] { grid-column:auto; }
    .thcy-controls.is-collapsed { width:48px; grid-template-columns:48px; }
    .thcy-controls.is-collapsed button { width:48px; }
    .thcy-weather { top: auto; bottom: calc(66px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px))); }
}
@media (max-height:320px) {
    .thcy-controls { top: calc(54px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))); }
    .thcy-weather { display: none; }
    .thcy-sheet { top: calc(4px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))); max-height: calc(100% - 4px - var(--safe-area-inset-top,env(safe-area-inset-top,0px))); border-radius: 16px 16px 0 0; }
}
@media (prefers-reduced-motion:reduce) { .thcy-root *, .thcy-root *::before, .thcy-root *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-motion:reduce) { .thcy-weather-ticker{height:auto}.thcy-weather-ticker>span{grid-area:auto;transform:none;opacity:1} }
[data-theme="dark"] .thcy-root,body.dark .thcy-root,body.dark-mode .thcy-root {
    --thcy-surface: var(--lmg-sub-bg, var(--th-wh-surface, #261f1a)); --thcy-card: var(--lmg-sub-component-bg, var(--th-wh-card, #302721));
    --thcy-ink: var(--lmg-text, var(--th-wh-ink, #f0e4da)); --thcy-muted: var(--lmg-text, var(--th-wh-muted, #bea898));
    --thcy-line: var(--lmg-border, var(--th-wh-line, #5a493e)); --thcy-selected: var(--lmg-active-bg, var(--th-wh-selected, #49382d)); --thcy-focus: var(--lmg-text, var(--th-wh-focus, #dfb79b));
}
