/* Recognition workspace */
/* Dynamic recognition dictionaries use native selects: accessible OS menus remain
   current when a language or a large word list changes, without a second dialog. */
html body .reverse-language-controls{display:grid;grid-template-columns:minmax(140px,auto) minmax(200px,360px);gap:8px 16px;align-items:center;margin-bottom:24px;color:var(--q-ink)}
html body .reverse-language-controls label{font-size:14px;font-weight:650}
html body .reverse-language-controls p{grid-column:1/-1;margin:0;color:var(--q-muted);font-size:13px;line-height:1.5}
html body :is(#reverseSignLanguage,#collectionWord,#collectionSearch){display:block;box-sizing:border-box;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--q-control-border);border-radius:10px;background:var(--q-surface);color:var(--q-ink);font:inherit;font-size:14px}
html body :is(#reverseSignLanguage,#collectionWord,#collectionSearch):focus-visible{outline:2px solid var(--q-focus);outline-offset:3px}
html body .reverse-candidate{padding:14px;border:1px solid var(--q-border);border-radius:12px;background:var(--q-canvas)}
html body .reverse-candidate[hidden]{display:none}
html body #collectionStorageNotice{font-size:12px;line-height:1.6;color:var(--q-muted)}
html body #collectionPanel :is(#collectionTrain,#collectionSync,#collectionImportLegacy){background:transparent;border-color:var(--q-control-border);color:var(--q-ink)}
html body #collectionSearch{margin:10px 0}
@media(max-width:600px){html body .reverse-language-controls{grid-template-columns:minmax(0,1fr)}}
html body .reverse-panel{padding:clamp(20px,2.4vw,34px);border:1px solid var(--q-border);border-radius:26px;background:var(--q-surface);box-shadow:0 18px 45px #071c2910}
html body .reverse-heading{margin:0 0 26px}
html body .reverse-heading .reverse-eyebrow{margin:0 0 10px;color:var(--q-primary);font-size:11px;letter-spacing:.15em;font-weight:700}
html body .reverse-heading h2{max-width:700px;margin:0 0 9px;color:var(--q-ink);font-size:clamp(25px,2.4vw,32px);letter-spacing:-.035em}
html body .reverse-heading p:not(.reverse-eyebrow){max-width:620px;margin:0;color:var(--q-muted);font-size:14px;line-height:1.65}
html body .reverse-layout{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(300px,.88fr);gap:18px;align-items:start}
html body .reverse-camera-panel{box-sizing:border-box;min-width:0;padding:12px;border:1px solid var(--q-border);border-radius:20px;background:var(--q-canvas)}
html body .reverse-camera-header{min-height:40px;padding:0 5px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--q-ink);font-size:13px;font-weight:650}
html body .reverse-camera-hint{font-size:12px;font-weight:400;color:var(--q-muted);text-align:right}
html body .reverse-camera{box-sizing:border-box;position:relative;width:100%;min-width:0;min-height:0;aspect-ratio:16/10;overflow:hidden;border:1px solid #ffffff1f;border-radius:14px;background:radial-gradient(ellipse at 50% 20%,#3b5869 0%,#203847 58%,#142632 100%)}
html body .reverse-camera video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transform:scaleX(-1)}
html body .reverse-placeholder{inset:0;display:flex;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:#f7f5ef}
html body .reverse-placeholder[hidden]{display:none}
html body .reverse-placeholder-icon{display:grid;place-items:center;width:64px;height:64px;margin-bottom:9px;border:1px solid #d9b69355;border-radius:20px;background:#e5bb9414;box-shadow:none}
html body .reverse-placeholder-icon svg{width:32px;height:32px;stroke:#d8b08c;stroke-width:1.6}
html body .reverse-placeholder strong{font-size:16px;font-weight:650}html body .reverse-placeholder>span:last-child{font-size:13px;color:#bccbd2}
html body .reverse-caption:not(:empty){bottom:14px;left:5%;right:5%;padding:10px 14px;border-radius:10px;background:#08141edc;color:#fff;line-height:1.35}
html body .reverse-camera-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 3px 2px}
html body .reverse-camera-footer #reverseStatus{flex:1 1 160px;margin:0;color:var(--q-muted);font-size:12px;line-height:1.5;text-align:right}
html body .reverse-actions{display:flex;flex-wrap:wrap;gap:8px}
html body .reverse-actions button{min-height:44px;padding:10px 15px;border:1px solid var(--q-control-border);border-radius:11px;background:transparent;color:var(--q-ink);font:inherit;font-size:13px;font-weight:650;cursor:pointer}
html body .reverse-actions button:first-child{background:var(--q-primary);border-color:var(--q-primary);color:var(--q-on-primary)}
html body .reverse-actions button:first-child:hover:not(:disabled){background:var(--q-primary-hover);border-color:var(--q-primary-hover)}
html body .reverse-actions button:focus-visible{outline:2px solid var(--q-focus);outline-offset:2px}
html body .reverse-result{box-sizing:border-box;min-width:0;padding:22px;border:1px solid var(--q-border);border-radius:20px;background:var(--q-canvas);display:flex;flex-direction:column;gap:14px}
html body .reverse-result-heading{display:flex;align-items:center;justify-content:space-between}
html body .reverse-result-kicker{margin:0 0 7px;color:var(--q-muted);font-size:10px;font-weight:700;letter-spacing:.13em}
html body .reverse-result-heading label{display:block;color:var(--q-ink);font-size:20px;font-weight:650;letter-spacing:-.025em}
html body .reverse-result textarea{box-sizing:border-box;width:100%;min-height:200px;padding:17px;border:1px solid var(--q-border);border-radius:13px;background:var(--q-surface);color:var(--q-ink);font:inherit;line-height:1.55;resize:vertical}
html body .reverse-result textarea::placeholder{color:var(--q-muted);opacity:.8}html body .reverse-result textarea:focus-visible{outline:2px solid var(--q-focus);outline-offset:2px}
html body .reverse-result .reverse-disclaimer{margin:0;color:var(--q-muted);font-size:12px;line-height:1.55}
html body .collection-toggle{align-self:flex-start;min-height:36px;margin:0;padding:7px 0;border:0;border-bottom:1px solid var(--q-control-border);border-radius:0;background:transparent;color:var(--q-ink);font-size:13px;font-weight:600;cursor:pointer}
html body .collection-toggle:hover{color:var(--q-primary)}html body .collection-panel{display:grid;gap:12px;margin-top:2px;padding-top:18px;border-top:1px solid var(--q-border)}html body .collection-panel[hidden]{display:none}
@media(max-width:800px){html body .reverse-layout{grid-template-columns:minmax(0,1fr);gap:14px}html body .reverse-camera{aspect-ratio:4/3}html body .reverse-result{padding:18px}html body .reverse-result textarea{min-height:145px}}
@media(max-width:440px){html body .reverse-panel{padding:18px}html body .reverse-camera-footer{align-items:stretch;flex-direction:column}html body .reverse-camera-footer #reverseStatus{text-align:left;flex:auto}html body .reverse-actions button{flex:1 1 auto}}
/* Match the two-card workspace used by Create video. */
html body #screen-studio .reverse-panel{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
html body #screen-studio .reverse-heading{display:none}
html body #screen-studio .reverse-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--q-space-6);align-items:start}
html body #screen-studio :is(.reverse-camera-panel,.reverse-result){box-sizing:border-box;min-width:0;padding:var(--q-space-6);border:1px solid var(--q-border);border-radius:var(--q-radius-card);background:var(--q-surface);color:var(--q-ink);box-shadow:var(--q-shadow)}
html body #screen-studio .reverse-camera-header{min-height:0;margin:0 0 16px;padding:0;color:var(--q-ink);font-size:20px;font-weight:650;line-height:1.3}
html body #screen-studio .reverse-camera-hint{font-size:13px;font-weight:500;color:var(--q-muted)}
html body #screen-studio .reverse-camera{aspect-ratio:16/10;border:0;border-radius:12px;background:linear-gradient(180deg,#203746,#192b36)}
html body #screen-studio .reverse-placeholder-icon{width:56px;height:56px;border:1px solid #ffffff22;border-radius:16px;background:#ffffff09}
html body #screen-studio .reverse-placeholder-icon svg{width:28px;height:28px}
html body #screen-studio .reverse-camera-footer{justify-content:flex-start;gap:12px;padding:16px 0 0;margin-top:16px;border-top:1px solid var(--q-border)}
html body #screen-studio .reverse-camera-footer #reverseStatus{text-align:left;flex:1 1 180px}
html body #screen-studio .reverse-result{gap:16px}
html body #screen-studio .reverse-result-kicker{display:none}
html body #screen-studio .reverse-result-heading{min-height:26px;margin:0 0 0}
html body #screen-studio .reverse-result-heading label{font-size:20px;line-height:1.3;letter-spacing:normal}
html body #screen-studio .reverse-result textarea{height:clamp(180px,24dvh,260px);min-height:180px;padding:0;border:0;border-radius:0;background:transparent;font-size:18px;line-height:1.6}
html body #screen-studio .reverse-result textarea:focus-visible{outline:2px solid var(--q-focus);outline-offset:4px}
html body #screen-studio .reverse-result .reverse-disclaimer{padding-top:16px;border-top:1px solid var(--q-border)}
html body #screen-studio .collection-toggle{min-height:44px;padding:7px 10px;border:1px solid var(--q-control-border);border-radius:10px;font-size:13px;text-decoration:none}
@media(max-width:800px){html body #screen-studio .reverse-layout{grid-template-columns:minmax(0,1fr);gap:16px}html body #screen-studio :is(.reverse-camera-panel,.reverse-result){padding:16px}html body #screen-studio .reverse-camera{aspect-ratio:4/3}html body #screen-studio .reverse-result textarea{height:160px;min-height:140px}}
@media(max-width:440px){html body #screen-studio .reverse-camera-footer{align-items:stretch;flex-direction:column}html body #screen-studio .reverse-camera-header{font-size:18px}}
#collectionTimer{display:block;width:100%;height:5px;accent-color:var(--q-primary);border:0;border-radius:4px;overflow:hidden;background:var(--q-soft)}#collectionTimer::-webkit-progress-bar{background:var(--q-soft)}#collectionTimer::-webkit-progress-value{background:var(--q-primary)}#collectionTimer::-moz-progress-bar{background:var(--q-primary)}#collectionTimer[hidden],#collectionCancel[hidden]{display:none!important}html body #collectionPanel[data-phase=record] #collectionStatus{color:var(--q-ink);font-weight:600}

html body #recognizeModePanel .reverse-language-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;margin-bottom:24px}html body #recognizeModePanel .reverse-language-controls>.modern-select{width:min(100%,320px)}html body .reverse-coverage{font-size:12px;color:var(--q-muted)}html body .reverse-coverage summary{cursor:pointer;padding:8px 0}html body .reverse-coverage p{max-width:60ch;margin:6px 0}

/* Keep both training actions inside the result card, aligned and able to wrap. */
html body #screen-studio .reverse-training-actions{display:flex;flex-wrap:wrap;align-items:stretch;gap:12px;min-width:0}
html body #screen-studio .reverse-training-actions>:is(button,a){display:inline-flex;align-items:center;justify-content:center;flex:0 1 auto;min-width:0;max-width:100%;min-height:44px;margin:0;padding:10px 14px;border:1px solid var(--q-control-border);border-radius:10px;background:transparent;color:var(--q-ink);font:600 13px/1.4 var(--q-type-font);text-align:center;text-decoration:none;white-space:normal}
html body #screen-studio .reverse-training-actions>:is(button,a):hover{background:var(--q-soft)}
@media(max-width:600px){html body #screen-studio .reverse-training-actions>:is(button,a){flex:1 1 100%;width:100%}}
