/* Workspace controls and responsive corrections; loaded after the legacy theme. */
[hidden] { display: none !important; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 3px;
}
body { background: #fafbfc; letter-spacing: 0; }
.shell { max-width: 1280px; }
.text-grid { gap: 12px; align-items: stretch; }
.text-panel { grid-template-rows: minmax(210px, 1fr) 48px; border-radius: 12px; box-shadow: 0 3px 12px #25334d08; overflow: hidden; }
.text-panel + .text-panel { background: #f0f5fb; }
.text-panel textarea { width: 100%; min-width: 0; min-height: 210px; height: 100%; resize: vertical; font-size: 20px; line-height: 1.7; text-align: start; }
.panel-title { height: 48px; min-height: 0; padding: 4px 12px; align-items: center; background: transparent; }
.panel-title .tool-button, .panel-title .speaker-button, .panel-title .mic-button { width: 36px; height: 36px; flex-basis: 36px; }
.actions { align-items: center; gap: 12px; flex-wrap: wrap; }
#textRequestStatus { flex: 1; min-width: 0; font-size: 13px; color: #5f6368; overflow-wrap: anywhere; }
#textRequestStatus:empty { display: none; }
#textRequestStatus.is-error { color: #a02020; }
.cancel-request { border: 0; background: transparent; color: #5f6368; padding: 8px; cursor: pointer; font: inherit; }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 128px; }
.primary-action.is-pending { opacity: 1; }
.primary-action.is-pending::before { content: ''; width: 15px; height: 15px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
#shareTextResult { flex: 0 0 40px; }
.language-picker-menu { overflow: hidden; padding: 8px; max-height: none; width: min(320px, calc(100vw - 24px)); }
.language-search { display: block; width: 100%; height: 42px; padding: 8px 12px; border: 1px solid #c5cbd4; border-radius: 6px; background: #fff; color: #202124; font: inherit; }
.language-options { max-height: min(330px, 45dvh); overflow-y: auto; margin-top: 8px; overscroll-behavior: contain; }
.language-picker-option { width: 100%; }
.language-picker-option:focus-visible { outline-offset: -2px; background: #e8f0fe; }
.language-empty { padding: 8px; margin: 0; color: #5f6368; }
body.text-fullscreen-open { overflow: hidden; }
body .text-panel.is-fullscreen { position: fixed; inset: 0; z-index: 110; width: 100%; height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); background: #fff; }
body .text-panel.is-fullscreen textarea { grid-row: 1; height: 100%; min-height: 0; padding: 24px; resize: none; font-size: 20px; }
body .text-panel.is-fullscreen .panel-title { grid-row: 2; height: auto; min-height: 56px; max-height: 100px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid #dadce0; border-bottom: 0; }
body .text-panel.is-fullscreen .fullscreen-button { background: #1a73e8; color: #fff; margin-inline-start: auto; }
.picture-text-card pre, .file-modal pre { unicode-bidi: plaintext; text-align: start; }
@media (max-width: 900px) {
    .text-panel, .text-panel + .text-panel { grid-template-rows: minmax(150px, auto) 44px; }
    .text-panel textarea, .text-panel + .text-panel textarea { min-height: 150px; }
}
@media (max-width: 640px) {
    body { background: #f8fafc; }
    .text-grid { padding-bottom: 104px; }
    .text-panel, .text-panel + .text-panel { border-radius: 10px; box-shadow: 0 2px 8px #25334d08; }
    .text-panel textarea, .text-panel + .text-panel textarea { min-height: 150px; font-size: 17px; padding: 12px 14px; }
    .panel-title { height: 44px; padding: 2px 8px; }
    .panel-title .tool-button, .panel-title .speaker-button, .panel-title .mic-button { width: 40px; height: 40px; flex-basis: 40px; }
    .actions { gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
    #textRequestStatus:not(:empty) { flex-basis: 100%; font-size: 12px; }
    .actions .primary-action { flex: 1; width: auto; min-width: 112px; min-height: 44px; }
    .language-picker-button { border-radius: 8px; box-shadow: none; border: 1px solid #e1e5eb; }
    .file-row, .website-row { margin: 12px 10px; border-radius: 10px; padding: 16px; }
    .site-footer { margin-bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) {
    .primary-action.is-pending::before { animation-duration: 2s; }
}
