:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-border: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --info-bg: rgba(59, 130, 246, 0.12);
    font-family: "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 45%),
        var(--bg);
    color: var(--text);
}

.page {
    max-width: 56rem;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 1.5rem;
}

.header-top {
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    justify-content: flex-start;
}

@media (min-width: 992px) {
    .header-actions {
        justify-content: flex-end;
    }
}

.header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.build-meta {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.messages {
    margin: 1rem 0 0;
}

.message {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.message:last-child {
    margin-bottom: 0;
}

.message-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.message-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.message-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.status {
    margin: 0.75rem 0 0;
    padding: 0.6rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
}

.status-info {
    background: var(--info-bg);
    color: var(--text);
}

.status-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.upload-form {
    margin-top: 1rem;
}

.drop-zone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0;
    padding: 0.85rem 1rem;
    border: 2px dashed var(--panel-border);
    border-radius: 0.75rem;
    background: var(--panel);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: #f8fbff;
    outline: none;
}

.drop-zone.has-file {
    border-style: solid;
    border-color: var(--accent);
}

.drop-zone.busy {
    opacity: 0.65;
    cursor: wait;
    pointer-events: none;
}

.file-input-native {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.drop-zone-text {
    flex: 1;
    min-width: 0;
}

.drop-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.drop-title code {
    font-size: 0.9em;
}

.selected-file {
    margin: 0.25rem 0 0;
    color: var(--success-text);
    font-size: 0.85rem;
    font-weight: 500;
    word-break: break-all;
}

.translate-mode-wrap {
    margin-top: 1rem;
}

.translate-mode-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.translate-mode-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 36rem;
    padding: 0.2rem;
    border: 1px solid var(--panel-border);
    border-radius: 0.65rem;
    background: #e2e8f0;
    gap: 0;
}

.translate-mode-switch .mode-segment {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mode-segment__label {
    font-weight: 600;
    line-height: 1.3;
}

.mode-segment__hint {
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--muted);
    opacity: 0.92;
}

.translate-mode-switch .mode-segment.is-active .mode-segment__hint {
    color: var(--muted);
}

.translate-mode-switch .mode-segment.is-active {
    color: var(--text);
}

.translate-mode-switch .mode-slider {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    height: calc(100% - 0.4rem);
    border-radius: 0.5rem;
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.translate-mode-switch.is-force-all .mode-slider {
    transform: translateX(100%);
}

.translate-mode-hint {
    margin: 0.45rem 0 0;
    max-width: 36rem;
}

.upload-options {
    margin-top: 1rem;
    border: 1px solid var(--panel-border);
    border-radius: 0.75rem;
    background: var(--panel);
    overflow: hidden;
}

.upload-options__section {
    padding: 0.95rem 1.1rem;
}

.upload-options__section + .upload-options__section {
    border-top: 1px solid var(--panel-border);
}

.upload-options__heading {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.upload-options__section--action .upload-options__heading {
    margin-bottom: 0.4rem;
}

.upload-options__tiles {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.65rem;
}

.upload-flow-join {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 1.15rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1;
    user-select: none;
}

.upload-flow-join--plus {
    font-size: 1.25rem;
    font-weight: 600;
}

.upload-option-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 100%;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--panel-border);
    border-radius: 0.55rem;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-option-tile:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.upload-option-tile:has(input:checked) {
    border-color: rgba(59, 130, 246, 0.45);
    background: #f8fbff;
}

.upload-option-tile--disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background: #f1f5f9;
}

.upload-option-tile--disabled:hover {
    border-color: var(--panel-border);
    background: #f1f5f9;
}

.upload-option-tile__head {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.upload-option-tile__label {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

.upload-option-tile__hint {
    margin: 0;
    padding-left: 1.35rem;
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--muted);
}

.upload-option-tile--compact .upload-option-tile__hint {
    padding-left: 1.35rem;
}

.upload-option-tile input[type="checkbox"] {
    margin: 0.12rem 0 0;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.upload-options__action {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.upload-options__model {
    flex: 1 1 14rem;
    min-width: 0;
    margin: 0;
}

.upload-options__model .form-select {
    font-size: 0.9rem;
}

.upload-options__llm-status {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #8a6d1b;
}

.upload-options__llm-status--error {
    color: #9b2c2c;
}

.upload-options__action .btn-submit {
    flex: 0 0 auto;
    min-width: 7.5rem;
}

.upload-style-grid {
    display: grid;
    grid-template-columns: minmax(11rem, 1.1fr) minmax(9rem, 1fr) auto minmax(9rem, 1fr);
    gap: 0.65rem;
    align-items: stretch;
}

.upload-style-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.upload-style-field__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.upload-style-field__extras {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-top: 0.1rem;
}

.upload-style-field__preview {
    align-self: flex-start;
}

.upload-style-field__meta {
    margin: 0;
    min-height: 0;
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--muted);
}

.upload-style-field__summary {
    margin-top: 0.1rem;
}

.upload-options__footnote {
    margin: 0.65rem 0 0;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--muted);
}

/* Legacy option helpers still used elsewhere */
.option-group {
    min-width: 0;
    padding-right: 0.25rem;
}

.option-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.option-hint {
    margin: 0.15rem 0 0 1.35rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--muted);
}

.option-row input[type="checkbox"] {
    margin: 0;
    accent-color: var(--accent);
}

.model-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin: 0;
    min-width: 0;
}

.model-label {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.btn-submit {
    width: auto;
    min-width: 6.5rem;
    max-width: 100%;
    padding: 0.4rem 0.9rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-submit:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.log-section {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0 1.25rem 2.5rem;
    box-sizing: border-box;
}

.log-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.log-section-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.clear-finished-form {
    margin: 0;
}

.btn-clear-finished {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--panel-border);
    border-radius: 0.5rem;
    background: var(--panel);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-clear-finished:hover {
    border-color: #b91c1c;
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* Translation progress cards */
.translation-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.translation-list-empty {
    margin: 0;
    padding: 1.25rem;
    border: 1px dashed var(--panel-border);
    border-radius: 0.75rem;
    text-align: center;
}

.translation-card {
    border: 1px solid var(--panel-border);
    border-radius: 0.75rem;
    background: var(--panel);
    padding: 1rem 1.15rem;
    width: 100%;
    min-width: 0;
}

.translation-card:nth-child(even) {
    background: #f8fafc;
}

.translation-card--processing {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.15);
}

.translation-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.translation-card__title-block {
    flex: 1;
    min-width: 0;
}

.translation-card__download {
    margin-left: auto;
    flex-shrink: 0;
}

.translation-card__download .result-row--header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-bottom: 0;
}

.translation-card__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.translation-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.translation-card__title a {
    color: inherit;
    text-decoration: none;
}

.translation-card__title a:hover {
    text-decoration: underline;
}

.translation-card__summary {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.step-checklist {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    padding: 0;
    width: 100%;
}

.step-checklist-item {
    display: flex;
    flex: 0 0 280px;
    gap: 0.45rem;
    align-items: flex-start;
    box-sizing: border-box;
    width: 280px;
    min-width: 0;
    min-height: 5.5rem;
    height: auto;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid transparent;
    box-shadow: inset 0 -1px 0 #e2e8f0;
}

@media (max-width: 479.98px) {
    .step-checklist-item {
        flex: 1 1 100%;
        width: 100%;
        min-height: 0;
    }
}

.step-checklist-item--ok {
    border-color: #bbf7d0;
}

.step-checklist-item--warning {
    border-color: #fde68a;
}

.step-checklist-item--error {
    border-color: #fecaca;
}

.step-checklist-item--active {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.step-checklist-item--pending {
    opacity: 0.72;
}

.step-checklist-item__icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1.3;
    margin-top: 0.05rem;
}

.step-checklist-item--ok .step-checklist-item__icon {
    color: #15803d;
}

.step-checklist-item--warning .step-checklist-item__icon {
    color: #b45309;
}

.step-checklist-item--error .step-checklist-item__icon {
    color: #b91c1c;
}

.step-checklist-item--active .step-checklist-item__icon {
    color: #0369a1;
}

.step-checklist-item--pending .step-checklist-item__icon {
    color: #94a3b8;
}

.step-checklist-item__icon--spin {
    animation: step-spin 1.2s linear infinite;
}

@keyframes step-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.step-checklist-item__body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.step-checklist-item__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.step-checklist-item__label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    min-width: 0;
}

.step-checklist-item__duration {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    white-space: nowrap;
}

.step-checklist-item__duration--elapsed {
    color: #0369a1;
    font-style: italic;
}

.step-checklist-item--ok .step-checklist-item__duration {
    color: #166534;
}

.step-checklist-item--error .step-checklist-item__duration {
    color: #b91c1c;
}

.step-checklist-item__message {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.step-config-table {
    width: 100%;
    margin-top: 0.15rem;
    border-collapse: collapse;
    font-size: 0.68rem;
    line-height: 1.35;
}

.step-config-table th,
.step-config-table td {
    padding: 0.12rem 0.35rem 0.12rem 0;
    vertical-align: top;
    text-align: left;
}

.step-config-table th {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    width: 38%;
}

.step-config-table td {
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.step-checklist-item__hints {
    margin: 0.2rem 0 0;
    padding-left: 1rem;
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.35;
    opacity: 0.92;
}

.step-checklist-item__hints li {
    margin: 0.1rem 0;
}

.step-checklist-item--warning .step-checklist-item__hints {
    color: #92400e;
}

.step-checklist-item__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.15rem;
}

.step-download-link {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.25;
    text-transform: lowercase;
    text-decoration: none;
    border-radius: 0.25rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
}

button.step-download-link {
    appearance: none;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.25;
    text-transform: lowercase;
}

.step-download-link:hover {
    border-color: #0ea5e9;
    color: #0369a1;
    background: #f0f9ff;
}

.step-download-link--error {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

.step-download-link--error:hover {
    border-color: #f87171;
    background: #fee2e2;
}

.step-download-link--secondary {
    border-style: dashed;
}

.step-log-btn {
    line-height: 1;
    vertical-align: middle;
}

.step-artifact-view {
    cursor: pointer;
}

.artifact-text-dialog {
    border: none;
    padding: 0;
    width: min(48rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    background: transparent;
}

.artifact-text-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.artifact-text-dialog__panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--panel-border);
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.artifact-text-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--panel-border);
    background: #f8fafc;
}

.artifact-text-dialog__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.artifact-text-dialog__content {
    flex: 1;
    margin: 0;
    padding: 0.75rem;
    overflow: auto;
    background: #fff;
}

.artifact-text-dialog__plain {
    margin: 0;
    padding: 0.25rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
}

.artifact-text-section {
    border: 1px solid var(--panel-border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    overflow: hidden;
}

.artifact-text-section:last-child {
    margin-bottom: 0;
}

.artifact-text-section__summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.artifact-text-section__summary::-webkit-details-marker {
    display: none;
}

.artifact-text-section__summary::before {
    content: "▸";
    display: inline-block;
    width: 0.85rem;
    color: #64748b;
    transition: transform 0.15s ease;
}

.artifact-text-section[open] > .artifact-text-section__summary::before {
    transform: rotate(90deg);
}

.artifact-text-section__body {
    margin: 0;
    padding: 0.75rem;
    border-top: 1px solid var(--panel-border);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.45;
    background: #fff;
    max-height: 24rem;
    overflow: auto;
}

.artifact-text-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--panel-border);
    background: #f8fafc;
}

.step-checklist-item__links--summary {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.35rem;
}

.step-summary-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.step-summary-downloads {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
}

.step-summary-downloads .step-download-link--translated {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: left;
    text-transform: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-download-link--translated {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.step-download-link--translated:hover {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

.step-checklist-item__source-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.25rem;
}

.step-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.25rem;
    width: 100%;
}

.step-progress-bar {
    width: 100%;
    height: 0.5rem;
    border: none;
    border-radius: 0.25rem;
    overflow: hidden;
    background: #e2e8f0;
}

.step-progress-bar::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 0.25rem;
}

.step-progress-bar::-webkit-progress-value {
    background: #0ea5e9;
    border-radius: 0.25rem;
}

.step-progress-bar::-moz-progress-bar {
    background: #0ea5e9;
    border-radius: 0.25rem;
}

.step-progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0c4a6e;
}

.translation-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--panel-border);
}

.translation-actions__spacer {
    flex: 1;
    min-width: 0.5rem;
}

.translation-details {
    margin-top: 0.65rem;
    font-size: 0.8rem;
}

.translation-details__summary {
    cursor: pointer;
    color: var(--muted);
    user-select: none;
    font-weight: 500;
}

.translation-details__body {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--panel-border);
}

.translation-details__times,
.translation-details__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.5rem 1rem;
    margin: 0 0 0.5rem;
}

.translation-details__times dt,
.translation-details__meta dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin: 0;
}

.translation-details__times dd,
.translation-details__meta dd {
    margin: 0.1rem 0 0;
    font-variant-numeric: tabular-nums;
}

.translation-row-log {
    margin-top: 0.65rem;
    font-size: 0.78rem;
}

.translation-row-log__summary {
    cursor: pointer;
    color: var(--muted);
    user-select: none;
    font-weight: 500;
}

.translation-row-log__body {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--panel-border);
}

.translation-row-log__placeholder,
.translation-row-log__empty {
    margin: 0;
    font-size: 0.76rem;
}

.translation-row-log__row,
.translation-row-log__call {
    margin: 0.35rem 0;
}

.translation-row-log__row-summary {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--text);
    font-size: 0.76rem;
}

.translation-row-log__call-title {
    color: var(--muted);
    font-size: 0.74rem;
    margin-bottom: 0.25rem;
}

.translation-row-log__row-body,
.translation-row-log__call-body {
    margin: 0.35rem 0 0.35rem 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--panel-border);
}

.log-field {
    margin: 0 0 0.5rem;
}

.log-field__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.log-field__value {
    margin: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 0.35rem;
    max-height: 16rem;
    overflow: auto;
}

.translation-row-log__error {
    margin: 0 0 0.35rem;
    font-size: 0.76rem;
}

.consistency-fixes {
    margin-top: 0.65rem;
    font-size: 0.78rem;
}

.consistency-fixes__summary {
    cursor: pointer;
    color: var(--muted);
    user-select: none;
    font-weight: 500;
}

.consistency-fixes__body {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--panel-border);
}

.consistency-fixes__placeholder,
.consistency-fixes__empty,
.consistency-fixes__stats {
    margin: 0 0 0.45rem;
    font-size: 0.76rem;
}

.consistency-fixes__row {
    margin: 0.35rem 0;
}

.consistency-fixes__row-summary {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--text);
    font-size: 0.76rem;
}

.consistency-fixes__row-body {
    margin: 0.35rem 0 0.35rem 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--panel-border);
}

.consistency-fixes__issue + .consistency-fixes__issue,
.consistency-fixes__issue--divider {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--panel-border);
}

.consistency-fixes__error {
    margin: 0;
    font-size: 0.76rem;
}

.translation-details__detail {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    line-height: 1.45;
}

.log-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--panel-border);
    border-radius: 0.75rem;
    background: var(--panel);
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.log-table th,
.log-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--panel-border);
    text-align: left;
    vertical-align: top;
}

.log-table th {
    background: #f1f5f9;
    font-weight: 600;
}

.status-cell {
    min-width: 10rem;
}

.status-cell .badge {
    margin: 0.25rem 0;
}

.status-time {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    line-height: 1.4;
}

.status-detail {
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.status-progress {
    margin-top: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0c4a6e;
    line-height: 1.3;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.style-export-buttons,
.document-artifacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.pipeline-steps {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    max-width: none;
    width: 100%;
}

.pipeline-steps-summary {
    cursor: pointer;
    color: var(--bs-secondary-color, #6c757d);
    user-select: none;
}

.pipeline-steps-meta {
    opacity: 0.85;
}

.pipeline-style-failed {
    margin-left: 0.25rem;
    font-size: 0.65rem;
    vertical-align: middle;
}

.pipeline-steps-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    border: 1px solid var(--panel-border);
    border-radius: 0.45rem;
    overflow: hidden;
    background: #fff;
}

.pipeline-steps-table th,
.pipeline-steps-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--panel-border);
    text-align: left;
    vertical-align: top;
}

.pipeline-steps-table thead th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    border-bottom-width: 2px;
}

.pipeline-steps-table tbody tr:last-child td {
    border-bottom: none;
}

.pipeline-steps-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.pipeline-steps-table tbody tr:hover {
    background: #f1f5f9;
}

.pipeline-steps-table .pipeline-step-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.pipeline-steps-table .pipeline-step-status {
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.pipeline-steps-table .pipeline-step-message {
    line-height: 1.4;
    word-break: break-word;
}

.pipeline-steps-table .pipeline-step-detail {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.72rem;
    line-height: 1.4;
    word-break: break-word;
}

.pipeline-step-row--error .pipeline-step-status,
.pipeline-step-row--error .pipeline-step-message {
    color: var(--bs-danger, #dc3545);
}

.pipeline-step-row--warning .pipeline-step-status,
.pipeline-step-row--warning .pipeline-step-message {
    color: var(--bs-warning-text-emphasis, #997404);
}

.status-log-btn {
    margin-top: 0.35rem;
}

.btn-cancel-job {
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
}

.btn-stop-job {
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
}

.result-delete-wrap {
    margin-top: 0.35rem;
}

.btn-delete-job {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
}

.results-cell {
    min-width: 14rem;
}

.result-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.result-row:last-child {
    margin-bottom: 0;
}

.result-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    text-align: left;
    font-weight: 500;
    border-color: var(--panel-border);
    color: var(--text);
    background: #f8fafc;
}

.result-download-btn:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
    background: var(--info-bg);
}

.result-download-btn--xml-invalid {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.result-download-btn--xml-invalid:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #7f1d1d;
}

.result-basename {
    font-weight: 600;
}

.result-datetime {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
}

.result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dictionary-artifacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.result-model,
.result-duration {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.result-duration {
    font-variant-numeric: tabular-nums;
}

.source-cell {
    min-width: 11rem;
}

.source-pick {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
}

.source-pick .source-lang-select {
    min-width: 10rem;
    font-size: 0.8rem;
}

.btn-source-continue {
    align-self: flex-start;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.log-table tr:last-child td {
    border-bottom: none;
}

.log-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.log-table a {
    color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #bbf7d0; color: #14532d; }
.badge-warning { background: #fde68a; color: #78350f; }
.badge-danger { background: #fecaca; color: #7f1d1d; }
.badge-no-credit { background: #fecaca; color: #7f1d1d; font-size: 0.65rem; letter-spacing: 0.03em; }
.badge-secondary { background: #e2e8f0; color: #334155; }
.badge-info { background: #bae6fd; color: #0c4a6e; }

.text-danger {
    color: #b91c1c;
}

.page-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 991.98px) {
    .upload-options__tiles {
        grid-template-columns: 1fr;
    }

    .upload-options__tiles .upload-flow-join {
        display: none;
    }

    .upload-style-grid {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .upload-style-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .upload-style-grid {
        grid-template-columns: 1fr;
    }

    .upload-style-grid .upload-flow-join {
        display: none;
    }

    .upload-options__action .btn-submit {
        width: 100%;
    }
}
