/* The workspace keeps the existing editor, language catalog and translation service. */
:root {
  --cor-page: #f3f6fa;
  --cor-surface: #fff;
  --cor-ink: #182d40;
  --cor-muted: #5d6e7d;
  --cor-line: #dce4eb;
  --cor-brand: #176d91;
  --cor-soft: #eaf4f8;
  --cor-success: #276d55;
}
body { margin: 0; background: var(--cor-page); color: var(--cor-ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Meetei Mayek", sans-serif; }
#wrapper { padding: 0; }
.visible-header { height: auto; min-height: 68px; padding: 10px 28px; background: var(--cor-surface); border-bottom: 1px solid var(--cor-line); gap: 12px; }
header #title { margin: 0; min-width: 0; gap: 8px; }
header #title img { width: auto; max-width: 110px; height: 38px; object-fit: contain; }
header #title h1 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; color: var(--cor-ink); }
.btn-logout { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--cor-line); border-radius: 8px; background: var(--cor-surface); color: var(--cor-muted); }
.correspondence-workspace { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); gap: 18px 12px; max-width: 1220px; margin: 0 auto; padding: 32px; }
.correspondence-workspace .wrapper-box-translator { display: contents; }
.correspondence-workspace .header-box-translator { display: block; min-width: 0; margin: 0; padding: 10px 16px; border: 1px solid var(--cor-line); border-radius: 10px; background: var(--cor-surface); }
.source-language { grid-column: 1; grid-row: 1; }
.target-language { grid-column: 3; grid-row: 1; }
.language-caption { display: block; font-size: 11px; font-weight: 600; color: var(--cor-muted); margin-bottom: 3px; }
.correspondence-workspace .language-box-translator { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; }
.correspondence-workspace .setting-flags { flex: 0 0 34px; width: 34px; }
.correspondence-workspace .setting-flags img { display: block; width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.correspondence-workspace .languages { display: block; flex: 1; min-width: 0; }
.correspondence-workspace .btn-swap { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; margin: 0; background: var(--cor-surface); color: var(--cor-brand); border: 1px solid var(--cor-line); border-radius: 50%; }
.correspondence-workspace .btn-swap:hover { background: var(--cor-soft); }
.editor-panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--cor-line); border-radius: 12px; background: var(--cor-surface); overflow: hidden; }
.source-panel { grid-column: 1 / 3; grid-row: 2; margin-right: 28px; }
.translation-panel { grid-column: 2 / 4; grid-row: 2; margin-left: 28px; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 20px; min-height: 44px; border-bottom: 1px solid var(--cor-line); }
.editor-heading h2 { margin: 0; color: var(--cor-muted); font-size: 12px; font-weight: 600; line-height: 1.5; }
.translation-panel .editor-heading { background: var(--cor-soft); }
.editor-caption { padding: 9px 20px; border-bottom: 1px solid var(--cor-line); font-size: 11px; color: var(--cor-muted); min-height: 35px; }
.auto-label { color: var(--cor-success); font-size: 11px; }
.correspondence-workspace .box-translator { position: relative; flex: 1; min-height: 300px; height: auto; font-family: inherit; }
.correspondence-workspace .textarea-translator { display: block; min-height: 300px; height: 100%; width: 100%; padding: 22px 24px; border: 0; border-radius: 0; font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Meetei Mayek", sans-serif; color: var(--cor-ink); background: var(--cor-surface); resize: none; }
.correspondence-workspace .result-text { position: relative; min-height: 300px; padding: 22px 24px; color: var(--cor-ink); font-size: 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-text p { margin: 0 0 1em; }
.result-text table { max-width: 100%; }
.translation-placeholder { position: absolute; top: 22px; left: 24px; right: 24px; margin: 0; color: var(--cor-muted); font-size: 16px; pointer-events: none; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 16px; min-height: 58px; border-top: 1px solid var(--cor-line); color: var(--cor-muted); font-size: 11px; }
.correspondence-workspace .btn { min-height: 44px; font-family: inherit; }
.correspondence-workspace .btn-translate { margin: 0; padding: 10px 20px; background: var(--cor-brand); color: #fff; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 600; }
.correspondence-workspace .btn-translate:hover { background: #145c7b; }
.correspondence-workspace .btn-copy { display: inline-flex; align-items: center; gap: 7px; padding: 8px; background: transparent; color: var(--cor-brand); border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.correspondence-workspace .btn-copy:hover { background: var(--cor-soft); }
.correspondence-workspace button:disabled { opacity: .5; cursor: default; }
.correspondence-workspace button:focus-visible, .btn-logout:focus-visible { outline: 3px solid var(--cor-brand); outline-offset: 2px; }
.correspondence-workspace .textarea-translator:focus-visible { outline: 2px solid var(--cor-brand); outline-offset: -3px; }
.workspace-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 11px; color: var(--cor-muted); }
.workspace-feedback { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; }
#workspace-status { margin: 0; font-size: 12px; color: var(--cor-muted); }
.workspace-feedback:has(#workspace-status:empty) { display: none; }
#wrapper-language-detected { grid-column: 1 / -1; font-size: 12px; color: var(--cor-muted); }
#text-language-detected { min-height: 44px; }
.correspondence-workspace .mobile-action, .language-name-short { display: none; }

/* Keep the full searchable language catalog and its flag images. */
.correspondence-workspace .select2-container { font-family: inherit; font-size: 14px; }
.correspondence-workspace .select2-selection--single { height: 44px; border: 0; background: transparent; border-radius: 5px; }
.correspondence-workspace .select2-container .select2-selection--single .select2-selection__rendered { font: 600 14px/44px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; color: var(--cor-ink) !important; padding: 0 22px 0 0; text-align: start; }
.correspondence-workspace .select2-container--default .select2-selection--single .select2-selection__arrow { display: block; height: 44px; right: 0; }
.correspondence-workspace .select2-selection__arrow b { border-top-color: var(--cor-muted) !important; }
.correspondence-workspace .select2-selection:focus-visible { outline: 3px solid var(--cor-brand); outline-offset: 2px; }
.select2-container.cor-language-dropdown { left: var(--language-dropdown-left) !important; }
.select2-dropdown { width: var(--language-dropdown-width, auto) !important; min-width: 0; padding: 6px; border: 1px solid var(--cor-line) !important; border-radius: 9px !important; background: var(--cor-surface); color: var(--cor-ink); box-shadow: 0 6px 24px #182d401a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.select2-container--open .select2-dropdown--below { min-width: 0; border: 1px solid var(--cor-line); box-shadow: 0 6px 24px #182d401a; }
.select2-search { margin: 0 0 6px; }
.select2-search--dropdown .select2-search__field, .select2-search--dropdown .select2-search__field:focus { height: 44px; padding: 10px !important; font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--cor-ink); background: var(--cor-page); border: 1px solid var(--cor-line) !important; }
.select2-search__field:focus-visible { outline: 2px solid var(--cor-brand); }
.select2-results { padding: 0; }
.select2-results__option { min-height: 44px; padding: 10px 8px; }
.select2-results__option .language-option { display: flex; align-items: center; gap: 9px; padding: 0; line-height: 1.4; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.language-option img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.select2-results__option .language-option span { padding: 0; font-size: 14px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--cor-soft); color: var(--cor-ink); font-weight: 400; font-family: inherit; }

@media (max-width: 640px) {
  .visible-header { min-height: 60px; padding: 9px 12px; }
  header #title { gap: 4px; }
  header #title img { height: 32px; max-width: 54px; }
  header #title h1 { font-size: 15px; }
  .correspondence-workspace { grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); padding: 12px; gap: 12px 0; }
  .correspondence-workspace .header-box-translator { padding: 5px 6px; border-radius: 0; border-inline: 0; }
  .correspondence-workspace .source-language { border-left: 1px solid var(--cor-line); border-radius: 10px 0 0 10px; }
  .correspondence-workspace .target-language { border-right: 1px solid var(--cor-line); border-radius: 0 10px 10px 0; }
  .language-caption { display: none; }
  .correspondence-workspace .language-box-translator { gap: 5px; }
  .correspondence-workspace .setting-flags { flex-basis: 23px; width: 23px; }
  .correspondence-workspace .setting-flags img { width: 23px; height: 23px; }
  .correspondence-workspace .btn-swap { height: 56px; width: 44px; align-self: stretch; border-radius: 0; border-inline: 0; }
  .correspondence-workspace .select2-container .select2-selection--single .select2-selection__rendered { font-size: 12px !important; padding-right: 13px; }
  .correspondence-workspace .select2-container--default .select2-selection--single .select2-selection__arrow { width: 12px; }
  .language-name-full { display: none; }
  .language-name-short { display: inline; }
  .source-panel, .translation-panel { grid-column: 1 / -1; margin: 0; }
  .source-panel { grid-row: 2; }
  .translation-panel { grid-row: 3; }
  .editor-heading { padding: 8px 14px; min-height: 44px; }
  .editor-caption { padding: 8px 16px; min-height: 30px; }
  .source-panel .editor-caption { display: none; }
  .correspondence-workspace .box-translator { min-height: 0; }
  .correspondence-workspace .textarea-translator { height: auto; min-height: 130px; padding: 14px 16px; line-height: 1.55; overflow: hidden; }
  .correspondence-workspace .result-text { min-height: 130px; padding: 14px 16px; line-height: 1.55; }
  .translation-placeholder { top: 14px; left: 16px; right: 16px; }
  .editor-footer { padding: 4px 12px; min-height: 36px; }
  .source-panel .editor-footer { min-height: 48px; }
  .correspondence-workspace .mobile-action { display: inline-flex; }
  .correspondence-workspace .editor-footer .btn-translate { border: 0; padding: 6px 10px; font-size: 12px; color: var(--cor-brand); background: transparent; }
  .correspondence-workspace .editor-footer .btn-translate:hover { background: var(--cor-soft); }
  .correspondence-workspace .editor-heading .btn-copy { background: var(--cor-brand); color: #fff; padding: 9px 14px; }
  .translation-panel .editor-footer .btn-copy, .workspace-actions { display: none; }
  .workspace-feedback { grid-row: 4; }
  #wrapper-language-detected { grid-row: 5; }
}
