
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg:     #0f0f13; --bg2: #16161d; --bg3: #1e1e28;
    --border: #2a2a38; --text: #e2e2e8; --muted: #6b6b80;
    --accent: #ff3c3c; --accent2: #ff7c3c; --green: #3cffa0;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }
  html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; color-scheme: dark; }
  html.i18n-loading body { visibility: hidden; }
  body { overflow-x: hidden; }
  [hidden] { display: none !important; }
  .app {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    min-height: 100vh;
    width: min(100%, 1920px);
    margin: 0 auto;
  }
  header {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 32px; border-bottom: 1px solid var(--border); background: var(--bg);
  }
  .logo-mark { width: 36px; height: 36px; flex-shrink: 0; background: var(--accent); border-radius: 6px; display: grid; place-items: center; }
  .logo-mark svg { width: 20px; height: 20px; }
  .logo-text h1 { font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
  .app-title-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }
  .app-version {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .8px;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
  }
  .logo-text p  { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
  .header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .lang-switch {
    position: relative;
  }
  .lang-switch-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text);
    border: 1px solid rgba(226, 226, 232, .12);
    background: rgba(255, 255, 255, .03);
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    min-height: 28px;
    min-width: 52px;
    transition: background .15s, border-color .15s;
    line-height: 1;
    text-align: center;
  }
  .lang-switch-trigger:hover,
  .lang-switch.open .lang-switch-trigger {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(226, 226, 232, .22);
  }
  .lang-switch-arrow {
    font-size: 9px;
    opacity: .75;
  }
  .lang-switch-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 96px;
    padding: 6px;
    border: 1px solid rgba(226, 226, 232, .12);
    border-radius: 14px;
    background: rgba(15, 15, 19, .98);
    box-shadow: 0 18px 48px rgba(0,0,0,.34);
    display: none;
    z-index: 20;
  }
  .lang-switch.open .lang-switch-menu {
    display: grid;
    gap: 4px;
  }
  .lang-switch-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    padding: 7px 12px;
    border-radius: 10px;
    transition: background .15s, color .15s, box-shadow .15s;
    text-align: center;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .lang-switch-btn.active {
    background: var(--accent);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset;
  }
  .help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    min-height: 24px;
    border-radius: 20px;
    border: 1px solid rgba(226, 226, 232, .12);
    background: rgba(255, 255, 255, .03);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
  }
  .help-link:hover {
    color: var(--text);
    border-color: rgba(226, 226, 232, .22);
    background: rgba(255, 255, 255, .06);
  }
  .help-drawer {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: flex-end;
    background: rgba(5, 5, 9, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 45;
  }
  .help-drawer.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .help-drawer-shell {
    width: min(560px, 100vw);
    height: 100vh;
    background: var(--bg2);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .24s ease;
    display: grid;
    grid-template-rows: auto 1fr;
    box-shadow: -20px 0 60px rgba(0,0,0,.35);
  }
  .help-drawer.visible .help-drawer-shell {
    transform: translateX(0);
  }
  .help-drawer-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
  }
  .help-drawer-title {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .help-close { width: auto; margin-left: auto; }
  .help-drawer-body {
    background: var(--bg);
    overflow: hidden;
  }
  .help-drawer-body .help-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 16px;
  }
  .help-drawer-body .help-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
  }
  .help-drawer-body h2 {
    font-size: 15px;
    margin: 0 0 8px;
  }
  .help-drawer-body p,
  .help-drawer-body li {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
  }
  .help-drawer-body ul,
  .help-drawer-body ol {
    margin: 10px 0 0 18px;
    padding: 0;
  }
  .help-drawer-body li + li { margin-top: 6px; }
  .badge-offline { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--green); border: 1px solid var(--green); padding: 3px 8px; border-radius: 20px; letter-spacing: .5px; opacity: 0; transition: opacity .4s; }
  .badge-offline.visible { opacity: 1; }
  main { display: grid; grid-template-columns: clamp(300px, 18vw, 380px) 1fr; gap: 0; overflow: hidden; }
  main { min-height: 0; }
  .panel-left { border-right: 1px solid var(--border); background: var(--bg2); display: flex; flex-direction: column; overflow-y: auto; }
  .panel-left,
  .panel-right { min-height: 0; }
  .section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
  .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
  .section-title { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin: 0; }
  .section-toggle {
    width: auto; padding: 0; background: transparent; border: 0; cursor: pointer;
    text-align: left; display: inline-flex; align-items: center; gap: 8px;
    font: inherit; color: inherit;
  }
  .section-toggle::after { content: '▾'; font-size: 10px; opacity: .7; transition: transform .2s; }
  .section.folded .section-toggle::after { transform: rotate(-90deg); }
  .section.folded .section-body { display: none; }
  .section.hidden { display: none; }
  .upload-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 60;
    min-width: min(92vw, 360px);
    max-width: min(92vw, 520px);
    padding: 14px 18px;
    border-radius: 12px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.4;
    color: #fff;
    text-align: center;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .12);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.96);
    transition: opacity .18s ease, transform .18s ease;
  }
  .upload-toast.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .upload-toast.success {
    background: rgba(45, 90, 39, .96);
  }
  .upload-toast.error {
    background: rgba(180, 40, 40, .96);
  }
  .dropzone { border: 1.5px dashed var(--border); border-radius: 10px; padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
  .dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(255,60,60,.04); }
  .dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
  .dropzone-icon { font-size: 28px; margin-bottom: 10px; }
  .dropzone p { font-size: 12px; color: var(--muted); line-height: 1.6; }
  .dropzone strong { color: var(--text); }
  .warn-box { margin-top: 10px; padding: 8px 10px; background: rgba(255,124,60,.1); border: 1px solid rgba(255,124,60,.3); border-radius: 6px; font-family: var(--mono); font-size: 10px; color: var(--accent2); display: none; }
  .warn-box.visible { display: block; }
  .phrases-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
  .phrase-row { display: flex; gap: 6px; align-items: center; }
  .phrase-row input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-family: var(--mono); font-size: 12px; color: var(--text); outline: none; transition: border-color .2s; }
  .phrase-row input:focus { border-color: var(--accent); }
  .phrase-row input::placeholder { color: var(--muted); }
  .btn-remove { width: 28px; height: 28px; border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 5px; font-size: 16px; display: grid; place-items: center; transition: color .2s, background .2s; flex-shrink: 0; }
  .btn-remove:hover { color: var(--accent); background: rgba(255,60,60,.1); }
  .options-grid { display: grid; gap: 10px; }
  .ocr-presets { display: grid; gap: 10px; margin-bottom: 14px; }
  .ocr-presets-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .ocr-preset-btn {
    width: auto;
    min-width: 88px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,.03);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
  }
  .ocr-preset-btn:hover {
    color: var(--text);
    border-color: rgba(226,226,232,.22);
    background: rgba(255,255,255,.06);
  }
  .ocr-preset-btn.active {
    color: #fff;
    border-color: transparent;
    background: var(--accent);
  }
  .ocr-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
  .opt-row { display: flex; align-items: center; justify-content: space-between; }
  .opt-label { font-size: 11px; color: var(--muted); }
  .opt-hint { font-size: 10px; line-height: 1.45; color: var(--muted); margin-top: -4px; }
  .color-row { display: flex; gap: 8px; }
  .color-swatch { width: 24px; height: 24px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; flex-shrink: 0; }
  .color-swatch.active { border-color: var(--text); }
  input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
  .btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 8px; padding: 10px 18px; font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; width: 100%; }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover:not(:disabled) { background: #ff5c5c; transform: translateY(-1px); }
  .btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
  .btn-secondary { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }
  .btn-secondary:hover { color: var(--text); border-color: var(--muted); }
  .btn-secondary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
  .btn-add { background: transparent; border: 1px dashed var(--border); color: var(--muted); font-size: 12px; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-family: var(--mono); transition: all .2s; width: 100%; }
  .btn-add:hover { border-color: var(--accent); color: var(--accent); }
  .panel-right { display: flex; flex-direction: column; overflow: hidden; }
  .toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
  .toolbar-title { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
  .count-badge { background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
  .toolbar-actions { margin-left: auto; display: flex; gap: 8px; }
  .files-area { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
  .files-area { min-height: 0; }
  .files-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 12px; font-size: 13px; }
  .files-empty-icon { font-size: 40px; opacity: .4; }
  .file-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; transition: border-color .2s; }
  .file-card.done       { border-color: var(--green); }
  .file-card.error      { border-color: var(--accent); }
  .file-card.processing { border-color: var(--accent2); }
  .file-icon {
    width: 100%;
    min-width: 76px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 9px;
    line-height: 1;
    letter-spacing: .3px;
    flex-shrink: 0;
    color: var(--text);
    font-family: var(--mono);
    text-transform: uppercase;
    overflow: hidden;
    text-align: center;
  }
  .file-icon-type {
    font-size: 10px;
    font-weight: 700;
  }
  .file-icon-count {
    font-size: 8px;
    opacity: .82;
    transform: scale(.95);
    transform-origin: center;
    white-space: nowrap;
    text-transform: none;
  }
  .file-icon.pdf { background: rgba(255,60,60,.12); }
  .file-icon.img { background: rgba(60,255,160,.12); }
  .file-info .file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .file-info .file-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; }
  .file-status { text-align: right; }
  .status-pill { display: inline-block; font-family: var(--mono); font-size: 10px; padding: 3px 8px; border-radius: 20px; letter-spacing: .5px; }
  .status-pill.waiting    { background: var(--bg3); color: var(--muted); }
  .status-pill.processing { background: rgba(255,124,60,.15); color: var(--accent2); }
  .status-pill.done       { background: rgba(60,255,160,.12); color: var(--green); }
  .status-pill.error      { background: rgba(255,60,60,.12); color: var(--accent); }
  .progress-bar-wrap { height: 2px; background: var(--border); border-radius: 1px; margin-top: 10px; grid-column: 1/-1; overflow: hidden; }
  .progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 1px; transition: width .3s; }
  .global-progress { padding: 12px 24px; border-top: 1px solid var(--border); background: var(--bg2); display: none; align-items: center; gap: 16px; flex-shrink: 0; }
  .global-progress.visible { display: flex; }
  .ocr-debug { font-family: var(--mono); font-size: 9px; color: var(--muted); background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; max-height: 140px; overflow: auto; white-space: pre-wrap; display: none; }
  .ocr-debug.visible { display: block; }
  .dev-log { font-family: var(--mono); font-size: 9px; color: #d7d7df; background: #0b0b10; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; height: 220px; overflow: auto; white-space: pre-wrap; }
  .dev-log-line { line-height: 1.45; }
  .dev-log-line + .dev-log-line { margin-top: 2px; }
  .log-actions { display: flex; gap: 8px; margin-top: 10px; }
  .btn-mini { width: auto; padding: 6px 12px; font-size: 11px; }
  .panel-right .section-top {
    margin-top: auto;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
  .btn-toolbar { width: auto; padding: 6px 14px; font-size: 12px; }
  .progress-fill { width: 0%; }
  .progress-full { grid-column: 1/-1; }
  .swatch-black { background: #000000; }
  .swatch-red { background: #ff3c3c; }
  .swatch-navy { background: #1a3a6b; }
  .swatch-green { background: #2d5a27; }
  progress.global-bar,
  progress.progress-bar {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 2px;
    overflow: hidden;
  }
  progress.global-bar::-webkit-progress-bar,
  progress.progress-bar::-webkit-progress-bar { background: var(--border); }
  progress.global-bar::-webkit-progress-value,
  progress.progress-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
  progress.global-bar::-moz-progress-bar,
  progress.progress-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
  .btn-inline {
    width: auto;
    padding: 3px 8px;
    font-size: 10px;
    font-family: var(--mono);
    border-radius: 5px;
    margin-top: 6px;
  }
  .file-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }
  .preview-modal {
    position: fixed; inset: 0; background: rgba(5,5,9,.78); display: none;
    align-items: center; justify-content: center; z-index: 50; padding: 24px;
  }
  .preview-modal.visible { display: flex; }
  .preview-shell {
    width: min(1100px, 96vw); height: min(92vh, 900px); background: var(--bg2);
    border: 1px solid var(--border); border-radius: 14px; display: grid;
    grid-template-rows: auto 1fr auto; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45);
  }
  .preview-head {
    padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px;
  }
  .preview-title { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
  .preview-body { background: #0b0b10; display: grid; place-items: center; overflow: auto; }
  .preview-body img, .preview-body canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border: 0;
    background: #fff;
  }
  .preview-actions { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
  .preview-meta { margin-right: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); }
  .preview-close {
    width: auto; padding: 6px 10px; font-size: 11px; margin-left: auto;
  }
  .section-body { display: block; }
  .opt-row select,
  .opt-row input[type="number"] {
    min-width: 120px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 10px;
    outline: none;
  }
  .opt-row input[type="range"] {
    width: 120px;
    accent-color: var(--accent);
  }
  .global-bar-wrap { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
  progress.global-bar {
    flex: 1;
    width: 100%;
    height: 4px;
    background: transparent;
    border-radius: 2px;
    transition: none;
  }
  progress.global-bar::-webkit-progress-bar { background: var(--border); }
  progress.global-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
  progress.global-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
  .global-label { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
  .app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 32px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    flex-wrap: wrap;
  }
  .app-footer-label {
    letter-spacing: .8px;
    text-transform: uppercase;
  }
  .app-footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .app-footer-links a {
    color: var(--muted);
    text-decoration: none;
  }
  .app-footer-links a:hover {
    color: var(--text);
    text-decoration: underline;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,124,60,.3); border-top-color: var(--accent2); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; margin-right: 4px; }
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  @media (min-width: 1600px) {
    .app { width: min(100%, 2160px); height: 100vh; }
    header { padding: 22px 36px; }
    .section { padding: 22px 28px; }
    .toolbar { padding: 16px 28px; }
    .files-area { padding: 22px 28px; gap: 12px; }
    .btn { font-size: 14px; }
    .btn-toolbar { padding: 7px 16px; font-size: 12px; }
    .file-card { padding: 16px 18px; }
    .preview-shell { width: min(1200px, 94vw); height: min(92vh, 960px); }
  }

  @media (max-width: 1440px) {
    .app { width: 100%; height: 100vh; }
    header { padding: 18px 24px; }
    .section { padding: 18px 20px; }
    .toolbar { padding: 12px 20px; }
    .files-area { padding: 18px 20px; }
    .panel-right .section-top { padding: 12px 20px; }
    .btn-toolbar { padding: 6px 12px; font-size: 11px; }
    .file-card { padding: 12px 14px; }
    .preview-shell { width: min(1040px, 96vw); height: min(90vh, 860px); }
  }

  @media (max-width: 1180px) {
    main { grid-template-columns: 300px 1fr; }
    .toolbar-actions { flex-wrap: wrap; }
    .toolbar-actions .btn-toolbar { flex: 1 1 auto; }
    .file-actions { flex-wrap: wrap; }
    .file-actions .btn-inline { flex: 1 1 auto; }
  }

  @media (max-width: 768px) {
    html, body { font-size: 13px; }
    .app {
      width: 100%;
      height: auto;
      min-height: 100svh;
      padding-bottom: 112px;
    }
    .app-footer {
      padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
      gap: 8px 10px;
    }
    .app-footer-label {
      width: 100%;
      font-size: 9px;
    }
    .app-footer-links {
      width: 100%;
      justify-content: flex-start;
      gap: 10px 12px;
    }
    header {
      padding: 12px 14px;
      gap: 10px;
      flex-wrap: wrap;
      align-items: flex-start;
    }
    .header-actions {
      width: 100%;
      margin-left: 0;
      justify-content: space-between;
      gap: 8px;
    }
    .lang-switch-menu { right: auto; left: 0; min-width: 104px; }
    .help-drawer-shell {
      width: 100vw;
    }
    .logo-mark { width: 32px; height: 32px; }
    .logo-mark svg { width: 18px; height: 18px; }
    .app-title-row { gap: 6px; }
    .app-version { font-size: 8px; }
    .logo-text h1 { font-size: 15px; }
    .logo-text p { font-size: 10px; }
    .badge-offline {
      margin-left: 0;
      width: 100%;
      text-align: center;
    }
    main {
      display: flex;
      flex-direction: column;
      overflow: visible;
    }
    .panel-left,
    .panel-right { display: contents; }
    .panel-right .section-top {
      order: 10;
      position: fixed;
      left: 14px;
      right: 14px;
      bottom: calc(12px + env(safe-area-inset-bottom));
      margin-top: 0;
      padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
      background: var(--bg2);
      border-top: 1px solid var(--border);
      border-radius: 14px 14px 0 0;
      box-shadow: 0 -14px 30px rgba(0, 0, 0, .35);
      z-index: 30;
    }
    .section {
      padding: 14px 14px;
    }
    .section-title {
      font-size: 9px;
      letter-spacing: 1.3px;
    }
    .section-top {
      margin-top: 0 !important;
      padding-top: 8px;
      padding-bottom: 10px;
    }
    .section-top .btn {
      min-height: 46px;
    }
    .panel-left > .section:nth-of-type(1) { order: 1; }
    .panel-left > .section:nth-of-type(2) { order: 2; }
    .panel-right > .toolbar { order: 3; }
    .panel-right > .files-area { order: 4; }
    .panel-right > .global-progress { order: 5; }
    .panel-left > .section:nth-of-type(3) { order: 6; }
    .panel-left > .section:nth-of-type(4) { order: 7; }
    .panel-left > .section:nth-of-type(5) { order: 8; }
    .panel-left > .section:nth-of-type(6) { order: 9; }
    .dropzone {
      padding: 20px 14px;
    }
    .dropzone-icon { font-size: 24px; }
    .dropzone p { font-size: 11px; line-height: 1.5; }
    .phrases-list { gap: 8px; }
    .phrase-row { gap: 6px; }
    .phrase-row input { font-size: 13px; padding: 8px 10px; }
    .btn-add { padding: 10px 12px; }
    .options-grid { gap: 8px; }
    .opt-row {
      align-items: flex-start;
      gap: 10px;
    }
    .opt-label {
      font-size: 10px;
      line-height: 1.35;
      max-width: 56%;
    }
    .opt-hint {
      font-size: 9px;
      line-height: 1.4;
    }
    .color-row { flex-wrap: wrap; justify-content: flex-end; }
    .toolbar {
      padding: 12px 14px;
      gap: 10px;
      flex-wrap: wrap;
      width: 100%;
    }
    .count-badge { order: 2; }
    .toolbar-title { width: 100%; }
    .toolbar-actions {
      order: 3;
      margin-left: 0;
      width: 100%;
      flex-wrap: wrap;
      gap: 8px;
    }
    .toolbar-actions .btn-toolbar {
      width: 100%;
      flex: 1 1 100%;
    }
    .panel-right .section-top .btn {
      width: 100%;
      min-height: 50px;
      box-shadow: none;
    }
    .files-area {
      padding: 12px 14px 16px;
      gap: 8px;
      width: 100%;
      overflow: visible;
    }
    .file-card {
      grid-template-columns: 68px 1fr;
      grid-template-rows: auto auto;
      align-items: start;
      gap: 10px;
      padding: 12px;
    }
    .file-info {
      min-width: 0;
    }
    .file-icon {
      min-width: 68px;
      height: 38px;
      font-size: 8px;
    }
    .file-icon-type { font-size: 10px; }
    .file-icon-count { font-size: 7px; }
    .file-info .file-name {
      font-size: 12px;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
      line-height: 1.35;
    }
    .file-status {
      grid-column: 1 / -1;
      display: flex;
      justify-content: flex-start;
      flex-wrap: wrap;
      gap: 6px;
      text-align: left;
    }
    .file-actions {
      justify-content: flex-start;
      width: 100%;
    }
    .file-actions .btn-inline,
    .file-status .btn-inline {
      flex: 1 1 calc(50% - 6px);
      min-width: 0;
    }
    .btn-inline {
      margin-top: 0;
      padding: 7px 10px;
      font-size: 10px;
    }
    .global-progress {
      padding: 10px 14px;
      gap: 12px;
      flex-wrap: wrap;
      width: 100%;
    }
    .global-bar-wrap {
      width: 100%;
    }
    .global-label {
      width: 100%;
      text-align: center;
    }
    .preview-modal {
      padding: 0;
      align-items: stretch;
      justify-content: stretch;
    }
    .preview-shell {
      width: 100%;
      height: 100%;
      max-width: none;
      max-height: none;
      border-radius: 0;
      grid-template-rows: auto minmax(0, 1fr) auto;
    }
    .preview-head,
    .preview-actions {
      padding: 10px 12px;
      flex-wrap: wrap;
      flex-shrink: 0;
    }
    .preview-meta {
      order: 3;
      width: 100%;
      margin-right: 0;
    }
    .preview-body {
      padding: 8px;
      min-width: 0;
      min-height: 0;
      overflow: auto;
    }
    .preview-body img,
    .preview-body canvas {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }
  }
  @media (min-width: 769px) {
    html, body { overflow: hidden; }
  }
