/* The onsen workbench inherits the phone's Tiny Home surfaces and typography. */
.thom-root { min-width: 0; color: var(--thos-ink); }
.thom-root *, .thom-root *::before, .thom-root *::after { box-sizing: border-box; }
.thom-root [hidden] { display: none !important; }
.thom-root, .thom-root * { scrollbar-width: none; -ms-overflow-style: none; }
.thom-root::-webkit-scrollbar, .thom-root *::-webkit-scrollbar { width: 0; height: 0; display: none; }
.thom-field { display: grid; gap: 7px; min-width: 0; margin: 0 0 14px; }
.thom-label { font-size: 13px; color: var(--thos-muted); }
.thom-person-modes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.thom-person-modes legend { margin-bottom: 9px; padding: 0; }
.thom-person-mode { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 48px; padding: 10px; border: 1px solid var(--thos-line); border-radius: 10px; background: var(--thos-surface); cursor: pointer; }
.thom-person-mode:has(input:checked) { border-color: var(--thos-accent); background: var(--thos-selected,#e5d9c6); }
.thom-person-mode:has(input:disabled) { opacity: .55; cursor: default; }
.thom-person-mode input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--thos-accent); }
.thom-person-mode span { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.thom-input { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 46px; margin: 0; padding: 10px 11px; border: 1px solid var(--thos-line); border-radius: 10px; background: var(--thos-surface); color: var(--thos-ink); font: inherit; line-height: 1.5; text-overflow: ellipsis; }
.thom-description { min-height: 92px; max-height: 240px; resize: vertical; }
.thom-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: end; }
.thom-editor { margin: 0 0 22px; border-block: 1px solid var(--thos-line); }
.thom-editor > summary { min-height: 52px; padding: 13px 0; cursor: pointer; }
.thom-editor-body { padding: 3px 0 16px; }
.thom-heading { margin: 0 0 12px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.thom-editor > .thom-heading { margin-bottom: 0; }
.thom-note { margin: 8px 0 14px; color: var(--thos-muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.thom-upload { display: grid; gap: 8px; margin: 14px 0 10px; min-width: 0; }
.thom-upload input { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; color: var(--thos-muted); font: inherit; font-size: 12px; }
.thom-upload input::file-selector-button { min-height: 44px; padding: 8px 12px; margin-right: 8px; border: 1px solid var(--thos-line); border-radius: 9px; background: var(--thos-surface); color: var(--thos-ink); cursor: pointer; }
.thom-reference-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.thom-reference { min-width: 0; margin: 0 0 14px; }
.thom-reference img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--thos-line); border-radius: 8px; background: var(--thos-surface); }
.thom-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.thom-button { min-width: 0; min-height: 44px; max-width: 100%; border: 1px solid var(--thos-line); border-radius: 10px; padding: 10px 13px; background: var(--thos-surface); color: var(--thos-ink); font: inherit; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation; }
.thos-root .thom-primary { color: var(--thg-action-text,#fffdf9); background: var(--thos-accent); border-color: var(--thos-accent); font-weight: 600; }
.thom-root .thom-remove { width: 100%; padding: 7px 0; margin-top: 4px; font-size: 12px; color: var(--thg-danger,#a23d30); background: transparent; border-color: transparent; }
.thom-choices { margin-top: 20px; }
.thom-pair-workbench { min-width: 0; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--thos-line); }
.thom-status { margin: 14px 0 22px; min-height: 24px; font-size: 12px; line-height: 1.7; color: var(--thos-muted); overflow-wrap: anywhere; }
.thom-status[data-state="error"], .thom-error { color: var(--thg-danger,#a23d30); }
.thom-results { min-width: 0; border-top: 1px solid var(--thos-line); padding-top: 20px; }
.thom-result { min-width: 0; margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--thos-line); }
.thom-result-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.thom-result-heading h4 { min-width: 0; margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.thom-badge { flex: 0 0 auto; font-size: 11px; color: var(--thos-muted); }
.thom-original-view { min-width: 0; margin: 8px 0 14px; }
.thom-original-view summary, .thom-previous > summary { min-height: 44px; padding: 10px 0; font-size: 12px; color: var(--thos-muted); cursor: pointer; overflow-wrap: anywhere; }
.thom-original { display: block; width: 100%; max-height: 330px; object-fit: contain; border-radius: 10px; background: var(--thos-surface); }
.thom-preview { display: grid; justify-items: center; min-width: 0; margin: 12px 0; padding: 12px; border: 1px solid var(--thos-line); border-radius: 12px; background: var(--thos-surface); }
.thom-preview-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 280px; object-fit: contain; }
.thom-preview > figcaption { margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.thom-preview-controls { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; align-items: center; width: 100%; }
.thom-preview-controls button { white-space: nowrap; }
.thom-frame-range { min-width: 0; width: 100%; height: 44px; accent-color: var(--thos-accent); }
.thom-empty { min-height: 140px; margin: 16px 0; padding: 30px 20px; display: grid; place-items: center; text-align: center; color: var(--thos-muted); font-size: 13px; background: var(--thos-surface); border-radius: 12px; }
.thom-previous { margin-bottom: 18px; }
.thom-root :is(button,input,select,textarea,summary):focus-visible { outline: 2px solid var(--thos-focus); outline-offset: 3px; }
.thom-root :disabled { opacity: .55; cursor: default; }
.thom-root button:active { opacity: .75; }
@media (hover:hover) { .thom-button:not(:disabled):hover,.thom-upload input::file-selector-button:hover { background: var(--thg-hover,#f0e8df); } .thos-root .thom-primary:not(:disabled):hover { background: var(--thg-action-hover,#7e513f); } }
@media (max-width:320px) { .thom-actions > .thom-button { flex: 1 1 auto; } .thom-row { gap: 8px; } .thom-input { padding-inline: 8px; } .thom-preview { padding: 8px; } .thom-preview-controls { gap: 6px; } .thom-preview-controls button { padding-inline: 8px; font-size: 12px; } }
