/* Compact scene controls; adopted character sheets share the original artwork plane. */
.thoa-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.thoa-actor { position: absolute; pointer-events: none; }
.thoa-actor[hidden] { display: none; }
.thoa-hits { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.tho-root .thoa-hit { position: absolute; min-width: 44px; min-height: 44px; padding: 0; transform: translate(-50%, -50%); border: 0; border-radius: 40%; background: transparent; pointer-events: auto; cursor: pointer; touch-action: manipulation; }
.tho-root .thoa-hit:disabled { pointer-events: none; }
.tho-root :where(.thoa-toggle, .thoa-menu button) {
    min-height: 44px; font: inherit; font-size: 13px; color: var(--tho-ink); background: var(--tho-paper);
    border: 1px solid #c8c3ae; border-radius: 12px; touch-action: manipulation; cursor: pointer;
}
.tho-root .thoa-toggle {
    position: absolute; z-index: 8; right: calc(14px + max(var(--thg-safe-area-right, 0px), var(--thg-viewport-inset-right, 0px)));
    bottom: calc(18px + max(var(--thg-safe-area-bottom, env(safe-area-inset-bottom, 0px)), var(--thg-viewport-inset-bottom, 0px)));
    padding: 0 18px; border-radius: 24px;
}
.thoa-menu {
    position: absolute; z-index: 9; right: calc(14px + max(var(--thg-safe-area-right, 0px), var(--thg-viewport-inset-right, 0px)));
    bottom: calc(74px + max(var(--thg-safe-area-bottom, env(safe-area-inset-bottom, 0px)), var(--thg-viewport-inset-bottom, 0px)));
    --thoa-accent: #637b68; --thoa-line: #c8c3ae; --thoa-error: #9b473b;
    width: min(320px, calc(100% - 28px)); max-height: calc(100% - 150px); padding: 14px; overflow: auto;
    border: 1px solid #c8c3ae; border-radius: 18px; background: var(--tho-paper); box-shadow: 0 4px 18px #142d2326;
    color: var(--tho-ink); touch-action: pan-y; scrollbar-width: none; overscroll-behavior: contain;
}
.thoa-menu::-webkit-scrollbar { display: none; width: 0; height: 0; }
.thoa-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.thoa-heading strong { font-size: 15px; }
.tho-root .thoa-close { width: 44px; padding: 0; border: 0; font-size: 22px; }
.thoa-person { display: grid; gap: 6px; min-width: 0; font-size: 12px; }
.thoa-people { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; padding: 3px 2px 6px; }
.tho-root .thoa-person-button { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; max-width: 100%; padding: 7px 12px; overflow-wrap: anywhere; border-radius: 22px; }
.thoa-person-button::before { content: ''; flex: 0 0 12px; width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%; }
.tho-root .thoa-person-button[aria-checked="true"] { border-color: var(--thoa-accent); color: var(--thoa-accent); background: color-mix(in srgb, var(--thoa-accent) 9%, var(--tho-paper)); }
.thoa-person-button[aria-checked="true"]::before { background: currentColor; box-shadow: inset 0 0 0 3px var(--tho-paper); }
.thoa-free-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 16px; padding: 10px 0; border-bottom: 1px solid var(--thoa-line); }
.thoa-free-copy { display: grid; gap: 4px; min-width: 0; }
.thoa-free-copy strong { font-size: 13px; font-weight: 500; }
.thoa-free-status { font-size: 11px; line-height: 1.5; }
.thoa-free-status[data-error="true"] { color: var(--thoa-error); }
.tho-root .thoa-free-toggle { position: relative; flex: 0 0 46px; width: 46px; height: 44px; padding: 0; border: 0; background: transparent; }
.thoa-free-toggle::before { content: ''; position: absolute; width: 42px; height: 24px; inset: 10px 2px; border-radius: 14px; background: var(--thoa-line); }
.thoa-free-toggle::after { content: ''; position: absolute; width: 18px; height: 18px; top: 13px; left: 5px; border-radius: 50%; background: var(--tho-paper); transition: transform .15s; }
.thoa-free-toggle[aria-checked="true"]::before { background: var(--thoa-accent); }
.thoa-free-toggle[aria-checked="true"]::after { transform: translateX(18px); }
.thoa-actions { display: grid; gap: 14px; margin: 12px 0; }
.thoa-action-group h3 { margin: 0 0 8px; font-size: 12px; font-weight: 500; }
.thoa-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.thoa-action-group:nth-child(2) .thoa-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tho-root .thoa-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 72px; padding: 8px 2px; font-size: 11px; line-height: 1.4; border: 1px solid transparent; background: transparent; }
.thoa-action-icon { width: 36px; height: 36px; object-fit: contain; pointer-events: none; }
.tho-root .thoa-action[aria-pressed="true"] { background: var(--thoa-accent); border-color: var(--thoa-accent); color: #fff; }
.thoa-action[aria-pressed="true"] .thoa-action-icon { filter: brightness(0) invert(1); }
.thoa-action[data-missing="true"] { border-style: dashed; border-color: var(--thoa-line); }
.tho-root .thoa-menu button:disabled { opacity: .5; cursor: default; }
.tho-root .thoa-menu button:active:not(:disabled) { opacity: .75; }
@media (hover: hover) { .tho-root .thoa-action:hover:not(:disabled):not([aria-pressed="true"]), .tho-root .thoa-person-button:hover { background: color-mix(in srgb, var(--thoa-accent) 12%, var(--tho-paper)); } }
.thoa-note { margin: 12px 0; font-size: 11px; line-height: 1.6; }
.tho-root .thoa-setup { width: 100%; padding: 8px; }
.tho-root .thoa-menu button:focus-visible { outline: 3px solid var(--tho-focus); outline-offset: 1px; }
.tho-root[data-ready="false"] .thoa-toggle { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .thoa-free-toggle::after { transition: none; } }
