@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f5f5f7;
  --white: #fff;
  --ink: #1d1d1f;
  --text: #303036;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --accent: #0071e3;
  --accent-hover: #0065cc;
  --accent-soft: #edf5ff;
  --error: #b42318;
  --radius: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
  font-size: 16px;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
[hidden] { display: none !important; }
button, a, select, .drop-zone, summary {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
:is(button, a, select, summary, textarea):focus-visible {
  outline: 3px solid #0071e3;
  outline-offset: 3px;
}
button:not(:disabled):active { transform: scale(.985); }
.masthead, main, footer { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.masthead { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.025em; text-decoration: none; color: var(--ink); }
.mark { display: flex; align-items: center; gap: 3px; height: 24px; }
.mark i { width: 3px; height: 11px; border-radius: 4px; background: var(--accent); }
.mark i:nth-child(2) { height: 23px; }
.mark i:nth-child(3) { height: 17px; }
.mark i:nth-child(4) { height: 8px; }
.local-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.local-label span { width: 6px; height: 6px; background: #298048; border-radius: 50%; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 24px 0 20px; }
h1 { margin: 0; font-size: clamp(32px, 3.3vw, 40px); line-height: 1.13; letter-spacing: -.038em; font-weight: 650; color: var(--ink); }
.edition { font-size: 13px; color: var(--muted); letter-spacing: -.01em; }
.small-label, .eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
.workspace { display: grid; grid-template-columns: 400px minmax(0, 1fr); overflow: hidden; border: 1px solid #dedee5; border-radius: var(--radius); background: var(--white); box-shadow: 0 3px 6px #1d1d1f02, 0 18px 48px #1d1d1f04; }
.input-panel { margin: 0; padding: 24px; background: var(--white); border-right: 1px solid var(--line); min-width: 0; }
.panel-heading { display: flex; align-items: center; gap: 10px; min-height: 32px; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.step { display: grid; place-items: center; width: 27px; height: 27px; font-size: 11px; color: var(--muted); background: #f1f1f4; border-radius: 50%; font-variant-numeric: tabular-nums; }
.panel-heading > .small-label { margin-left: auto; font-size: 10px; letter-spacing: .04em; }
.drop-zone { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; min-height: 148px; padding: 14px; overflow: hidden; border: 1px dashed #c6c8d0; border-radius: 16px; background: #fafafc; text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.drop-zone.drag-over { box-shadow: inset 0 0 0 1px var(--accent); }
.drop-zone:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-zone strong { max-width: 100%; font-size: 16px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.drop-zone > span { pointer-events: none; }
.upload-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 3px; border-radius: 12px; background: #eaf2ff; color: var(--accent); font-size: 27px; font-weight: 400; }
.drop-zone #file-detail { font-size: 13px; color: var(--muted); line-height: 1.4; }
.file-types { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .01em; }
.file-meta { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 18px; font-size: 12px; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }
.language-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.field { min-width: 0; }
.field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 550; color: var(--ink); }
select { width: 100%; min-width: 0; height: 46px; padding: 0 10px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; }
select:hover:not(:disabled) { border-color: #a6a7ae; }
select:disabled { background: #f5f5f7; color: var(--muted); opacity: 1; }
.model-choice { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.model-choice legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 550; color: var(--ink); }
.model-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid #e8e8ed; border-radius: 14px; background: #f2f2f5; }
.model-tabs button { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; min-height: 64px; min-width: 0; padding: 10px 3px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #56565e; }
.model-tabs strong { font-size: 13px; font-weight: 600; letter-spacing: -.02em; }
.model-tabs span { font-size: 11px; line-height: 1.3; }
.model-tabs button:hover:not(:disabled) { background: #ffffff9c; }
.model-tabs [aria-checked="true"] { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 5px #0071e322; }
.model-tabs [aria-checked="true"]:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.model-tabs button:disabled { opacity: .6; }
.model-tabs [aria-checked="true"]:disabled { opacity: 1; color: #fff; }
.model-tabs button:focus-visible { outline-offset: 1px; }
.model-choice p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.feedback-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 8px; min-height: 84px; padding-top: 12px; }
#preload-state { grid-column: 1 / -1; grid-row: 1; min-height: 18px; margin: 0 0 8px; font-size: 12px; line-height: 1.5; color: #576371; }
.feedback-block .status { grid-column: 1; grid-row: 2; align-self: center; }
.feedback-block .cancel { grid-column: 2; grid-row: 2; width: auto; min-height: 44px; margin: 0; padding: 8px; }
.feedback-block progress { grid-column: 1 / -1; grid-row: 3; }
.busy #preload-state { display: none; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 12px 17px; border: 1px solid transparent; border-radius: 12px; background: var(--accent); color: #fff; font-size: 15px; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; }
.primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 3px 10px #0071e318; }
.primary:disabled { background: #e8e8ed; color: #777780; }
.primary > .run-indicator { flex-shrink: 0; font-size: 20px; line-height: 1; font-weight: 400; }
.busy .primary:disabled { background: var(--accent); color: #fff; }
.busy .run-indicator { width: 17px; height: 17px; border: 2px solid #ffffff55; border-top-color: #fff; border-radius: 50%; font-size: 0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cancel { width: 100%; min-height: 44px; padding: 9px 12px; margin-top: 6px; border: 0; border-radius: 10px; background: transparent; color: var(--accent); font-size: 13px; }
.cancel:hover { background: var(--accent-soft); }
.status { margin: 0; min-height: 20px; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.status.error { padding: 10px 12px; border-radius: 10px; background: #fff1ef; color: var(--error); }
.status.success { color: #216e39; }
progress { display: block; width: 100%; height: 5px; margin: 10px 0 0; border: 0; border-radius: 99px; background: #e8e8ed; accent-color: var(--accent); overflow: hidden; }
progress::-webkit-progress-bar { background: #e8e8ed; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.first-run { margin: 8px 0 18px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.privacy-note { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.privacy-note span { font-size: 18px; color: var(--accent); }
.output-panel { display: flex; flex-direction: column; min-width: 0; padding: 28px 30px 24px; background: #fdfdfe; }
.text-button { min-height: 36px; min-width: 44px; margin-left: auto; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font-size: 13px; }
.text-button:hover:not(:disabled) { background: var(--accent-soft); }
.text-button:disabled { color: #898990; }
.output-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.output-bar [role="tablist"] { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #ededf1; }
.output-bar [role="tab"] { min-height: 34px; padding: 6px 15px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #606069; font-size: 13px; font-weight: 550; }
.output-bar [aria-selected="true"] { background: #fff; border-color: #e1e1e6; color: var(--ink); box-shadow: 0 1px 3px #1d1d1f0a; }
.output-bar .small-label { font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums; text-align: right; }
.version-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 4px; margin-bottom: 18px; border: 1px solid #e3e6eb; border-radius: 13px; background: #f0f2f5; }
.version-switch button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 58px; min-width: 0; padding: 9px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #62626b; }
.version-switch strong { font-size: 14px; font-weight: 600; }
.version-switch span { max-width: 100%; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version-switch button[aria-checked="true"] { background: #fff; border-color: #cbdff8; color: #0066cc; box-shadow: 0 2px 4px #1d1d1f0a; }
.version-switch button:hover:not(:disabled) { background: #fff; }
.version-switch button:disabled { color: #81818a; box-shadow: none; }
.version-switch button:disabled[aria-checked="true"] { border-color: #e2e4e8; background: #ffffffb0; }
.version-switch button:focus-visible { outline-offset: 1px; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; flex: 1; min-height: 310px; padding: 36px 12px; text-align: center; }
.paper-icon { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 54px; margin-bottom: 8px; padding: 11px; border: 1px solid #d4dce8; border-radius: 9px; background: #f2f6fc; }
.paper-icon i { display: block; height: 2px; border-radius: 2px; background: #90a7c6; }
.paper-icon i:last-child { width: 60%; }
.empty-state p { margin: 16px 0 12px; color: #62626b; font-size: 27px; line-height: 1.25; letter-spacing: -.035em; font-weight: 500; }
.empty-state > span:last-child { max-width: 260px; color: var(--muted); font-size: 13px; line-height: 1.5; }
[role="tabpanel"] { display: flex; flex: 1; min-height: 310px; }
textarea { width: 100%; min-width: 0; min-height: 310px; resize: vertical; padding: 24px 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.75; letter-spacing: -.01em; overflow-wrap: anywhere; }
#subtitles { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.7; letter-spacing: 0; }
.output-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.output-notes { max-width: 180px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.output-actions { display: flex; gap: 8px; }
.secondary, .dark-button { min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 10px; background: #eeeeF2; color: var(--ink); font-size: 13px; font-weight: 550; white-space: nowrap; }
.secondary:hover:not(:disabled) { background: #e4e4eb; }
.dark-button { background: var(--accent); color: #fff; }
.dark-button:hover:not(:disabled) { background: var(--accent-hover); }
.secondary:disabled, .dark-button:disabled { background: #efeff3; color: #81818a; }
.dark-button span { margin-left: 7px; }
.under-workspace { display: flex; justify-content: space-between; gap: 12px; margin: 16px 3px 0; color: var(--muted); font-size: 11px; line-height: 1.5; letter-spacing: .035em; }
.under-workspace span:last-child { letter-spacing: 0; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); }
.eyebrow { display: block; margin-bottom: 14px; font-size: 11px; letter-spacing: .08em; }
.details-grid h2, .faq h2 { margin: 0 0 20px; color: var(--ink); font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.03em; }
.details-grid p, .questions p { margin: 0 0 16px; color: #62626b; font-size: 15px; line-height: 1.7; letter-spacing: -.01em; }
.details-grid strong { color: var(--ink); font-weight: 600; }
.faq { display: grid; grid-template-columns: 1fr 1.5fr; gap: 70px; margin: 64px 0 72px; padding-top: 40px; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { position: relative; padding: 20px 30px 20px 0; color: var(--ink); font-size: 15px; font-weight: 550; line-height: 1.5; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; top: 18px; right: 2px; color: var(--muted); font-size: 21px; font-weight: 400; }
details[open] summary::after { content: "−"; }
.questions p { padding-right: 24px; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding: 24px 0 36px; color: var(--muted); font-size: 12px; }
footer .wordmark { font-size: 13px; }
footer a { padding: 8px 0; text-decoration: none; }
footer a:hover { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100% - 48px); margin: auto; padding: 28px; overflow-y: auto; border: 1px solid #d9d9e0; border-radius: 24px; background: #fff; color: var(--ink); box-shadow: 0 20px 80px #0003; }
dialog::backdrop { background: #1d1d1f55; }
dialog form { margin: 0; }
dialog h2 { margin: 0 0 14px; font-size: 25px; line-height: 1.2; letter-spacing: -.03em; font-weight: 600; }
dialog p { margin: 0 0 26px; color: #62626b; font-size: 15px; line-height: 1.6; white-space: pre-line; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions button { min-height: 46px; font-size: 15px; }

@media (min-width: 1500px) {
  .empty-state, [role="tabpanel"], textarea { min-height: 340px; }
}
@media (max-width: 1040px) {
  .masthead, main, footer { width: calc(100% - 40px); }
  .workspace { grid-template-columns: 370px minmax(0, 1fr); }
  .input-panel, .output-panel { padding: 24px; }
  .output-footer { flex-wrap: wrap; gap: 12px; }
  .output-notes { max-width: none; }
  .details-grid { gap: 48px; }
  .edition { display: none; }
}
@media (max-width: 800px) {
  .masthead, main, footer { width: calc(100% - 32px); }
  .masthead { height: 64px; }
  .title-row { margin: 24px 0 20px; }
  h1 { font-size: 34px; }
  .workspace { display: block; border-radius: 20px; }
  .input-panel { padding: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .output-panel { padding: 24px 22px; }
  .drop-zone { min-height: 146px; }
  .empty-state, [role="tabpanel"], textarea { min-height: 260px; }
  .output-footer { flex-wrap: nowrap; }
  .details-grid { display: block; margin-top: 48px; padding-top: 32px; }
  .details-grid article + article { margin-top: 36px; }
  .faq { display: block; margin: 44px 0 48px; padding-top: 32px; }
  .faq > div:first-child { margin-bottom: 16px; }
  .details-grid h2, .faq h2 { font-size: 25px; }
  select, textarea { font-size: 16px; }
}
@media (max-width: 480px) {
  .wordmark { font-size: 14px; gap: 8px; }
  .local-label { font-size: 11px; gap: 6px; }
  h1 { font-size: 32px; }
  .input-panel, .output-panel { padding: 20px; }
  .panel-heading { margin-bottom: 16px; }
  .panel-heading > .small-label { display: none; }
  .drop-zone { min-height: 142px; padding: 14px 10px; }
  .upload-icon { width: 36px; height: 36px; font-size: 25px; }
  .file-types { font-size: 10px; }
  .file-meta { margin-bottom: 20px; font-size: 11px; gap: 8px; }
  .language-fields { gap: 10px; margin-bottom: 20px; }
  .field-label, .model-choice legend { font-size: 12px; }
  .model-tabs button { min-height: 62px; }
  .model-tabs strong { font-size: 13px; }
  .model-tabs span { font-size: 11px; }
  .model-choice p { font-size: 12px; }
  #preload-state { font-size: 11px; }
  .primary { min-height: 52px; }
  .output-bar { flex-wrap: wrap; row-gap: 10px; }
  .output-bar .small-label { margin-left: auto; font-size: 10px; letter-spacing: .02em; }
  .output-bar [role="tab"] { padding-inline: 13px; min-height: 38px; }
  .empty-state p { font-size: 26px; }
  .output-footer { display: block; }
  .output-notes { display: block; margin-bottom: 14px; font-size: 12px; }
  .output-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .secondary, .dark-button, .text-button { min-height: 44px; }
  .under-workspace { font-size: 10px; letter-spacing: .01em; }
  .under-workspace span:last-child, footer > span:nth-child(2) { display: none; }
  footer { padding-bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.output-notes { display: flex; flex-direction: column; gap: 3px; }
#output-feedback { min-height: 18px; color: #0066cc; }

.cache-controls { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:20px; }
#cache-status { flex:1 1 180px; color:var(--muted); font-size:12px; line-height:1.5; }
