@font-face {
    font-family: 'FilmProcessorFavorit';
    src: url('/assets/fonts/FilmProcessorFavorit-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'FilmProcessorFavorit';
    src: url('/assets/fonts/FilmProcessorFavorit-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/assets/fonts/JetBrainsMono-Latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: block;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --background-black: #000000;
    --heading-cyan: #00b9c7;
    --film-purple: #b40096;
    --title-white: #fffedc;
    --field-gray: #333333;
    --panel-fill: #050505;
    --panel-stroke: #444444;
    --soft-gray: rgba(255, 254, 220, 0.58);
    --dcp-success: #22c55e;
    --success-green: #22c55e;
    --warning-yellow: #eab308;
    --error-red: #ef4444;
}

* {
    box-sizing: border-box;
}

*:focus {
    outline: none;
}

*:focus-visible {
    outline: 1px solid var(--heading-cyan);
    outline-offset: 2px;
}

body {
    font-family: 'FilmProcessorFavorit', 'Inter', sans-serif;
    max-width: none;
    margin: 0;
    background: var(--background-black);
    color: var(--title-white);
    font-weight: 300;
    line-height: 1.5;
    overflow-x: hidden;
}

.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;
}

.container {
    padding: 0 150px 2rem 150px;
}

.page-title {
    font-family: 'FilmProcessorFavorit', 'Inter', sans-serif;
    font-size: 3.7rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--title-white);
    margin: 0 0 1rem;
    text-align: center;
}

.page-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.15;
    color: var(--heading-cyan);
    text-align: center;
    margin: 0 0 2.375rem;
}

.page-intro {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--soft-gray);
    max-width: 68rem;
    margin: 1rem auto 3rem;
    text-align: center;
}

.upscaler-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.upscaler-grid > * {
    min-width: 0;
}

.card {
    background: var(--background-black);
    border: 1px solid var(--field-gray);
    padding: 0.75rem 1.5rem 1.5rem;
    transition: all 0.2s ease;
    animation: fadeIn 0.5s ease-out;
}

.card:hover {
    border-color: var(--heading-cyan);
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

.span-2 {
    grid-column: 1 / -1;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--film-purple);
    border-bottom: 1px solid var(--film-purple);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.section-copy {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: rgba(255, 254, 220, 0.72);
    margin: 0 0 1rem;
}

.compact-copy {
    margin-bottom: 0.75rem;
}

.processing-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.processing-choice > * {
    min-width: 0;
}

.browser-model-control {
    margin-top: 0.75rem;
}

.choice-option {
    appearance: none;
    background: var(--background-black);
    border: 1px solid var(--field-gray);
    color: var(--soft-gray);
    padding: 8px 12px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.choice-option:hover {
    border-color: var(--film-purple);
    color: var(--title-white);
}

.choice-option.selected {
    border-color: var(--heading-cyan);
    color: var(--heading-cyan);
}

.choice-option.is-disabled {
    opacity: 0.55;
}

.choice-title {
    font-size: 0.85rem;
    line-height: 1.2;
}

.choice-option-copy {
    font-size: 0.7rem;
    line-height: 1.3;
    color: rgba(255, 254, 220, 0.56);
}

.hw-accel-status {
    margin-top: 0.75rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 1rem;
}

.hw-badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background: var(--field-gray);
}

.hw-badge.is-ready {
    background: var(--success-green);
    box-shadow: 0 0 4px var(--success-green);
}

.hw-badge.is-warning {
    background: var(--warning-yellow);
    box-shadow: 0 0 4px var(--warning-yellow);
}

.hw-badge.is-error {
    background: var(--error-red);
    box-shadow: 0 0 4px var(--error-red);
}

#hwAccelInfo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    color: rgba(255, 254, 220, 0.66);
}

.upload-area {
    position: relative;
    border: 1px dashed var(--field-gray);
    padding: 3rem 2rem;
    display: grid;
    place-items: center;
    text-align: center;
    background: rgba(17, 17, 17, 0.3);
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--heading-cyan);
    background: rgba(0, 185, 199, 0.05);
}

.upload-area.is-loaded {
    border-style: solid;
}

.upload-area.is-dragover {
    border-color: var(--film-purple);
    background: rgba(180, 0, 150, 0.1);
    transform: scale(1.01);
}

.upload-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--title-white);
    margin-bottom: 0.45rem;
}

.upload-subtext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #888;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-input-hidden {
    display: none;
}

.preview-shell {
    position: relative;
    border: 1px solid var(--field-gray);
    background: var(--panel-fill);
    overflow: hidden;
    min-height: 18rem;
}

.preview-empty {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    color: rgba(255, 254, 220, 0.62);
    text-align: center;
    z-index: 1;
}

.preview-video-stage,
.preview-shell img,
.preview-shell video {
    width: 100%;
    height: 100%;
    display: none;
    background: #000000;
}

.preview-video-stage {
    position: relative;
    min-height: 18rem;
}

.preview-shell.is-image img,
.preview-shell.is-video .preview-video-stage {
    display: block;
}

.preview-video-stage video {
    width: 100%;
    height: auto;
    display: block;
    background: #000000;
}

.preview-shell.is-image .preview-empty,
.preview-shell.is-video .preview-empty {
    display: none;
}

.preview-shell.is-empty .preview-empty {
    display: grid;
}

#previewImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 15px;
    opacity: 1;
    transition: opacity 0.15s ease;
}

.video-main-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    --playbar-visible-gap: 24px;
}

.video-control-icon {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--film-purple);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.video-control-icon:hover {
    background: transparent !important;
    color: var(--title-white);
    transform: scale(1.1);
}

.play-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 12px solid currentColor;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 2px;
}

.play-icon.is-playing::before {
    width: 10px;
    height: 16px;
    border: none;
    margin-left: 0;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 3px 16px no-repeat,
        linear-gradient(currentColor, currentColor) 7px 0 / 3px 16px no-repeat;
}

.stop-icon::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    background: currentColor;
}

.fullscreen-icon::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background:
        linear-gradient(currentColor, currentColor) 2px 2px / 6px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 2px / 2px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 8px 2px / 6px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 12px 2px / 2px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 12px / 6px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 2px 8px / 2px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 8px 12px / 6px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 12px 8px / 2px 6px no-repeat;
}

.video-progress-container {
    flex: 1;
    position: relative;
    min-height: 16px;
    display: flex;
    align-items: center;
    margin-left: calc(var(--playbar-visible-gap) - 17px);
}

.video-progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
}

.video-progress-selection {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.selection-before,
.selection-active,
.selection-after {
    position: absolute;
    top: 0;
    height: 100%;
}

.selection-before,
.selection-after {
    background: rgba(136, 136, 136, 0.48);
}

.selection-active {
    background: rgba(255, 254, 220, 0.26);
}

.video-progress-fill {
    height: 100%;
    background: rgba(255, 254, 220, 0.6);
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.video-progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fffedc;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-progress-container:hover .video-progress-handle {
    opacity: 1;
}

.video-time-display {
    flex: 0 0 auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    min-width: 0;
    margin-left: calc(var(--playbar-visible-gap) - 10px);
    white-space: nowrap;
    text-align: left;
}

.volume-slider {
    flex: 0 0 72px;
    width: 72px;
    height: 2px;
    background: transparent;
    outline: none;
    cursor: pointer;
    appearance: none;
    margin: 0 0 0 calc(var(--playbar-visible-gap) - 10px);
}

.fullscreen-icon {
    margin-left: calc(var(--playbar-visible-gap) - 16px);
}

.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fffedc;
    border: 0;
    margin-top: -5px;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border: 0;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fffedc;
    border: 0;
}

.summary-row {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(68, 68, 68, 0.7);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label,
.field-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--film-purple);
}

.summary-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--title-white);
    min-height: 1rem;
}

.control-stack {
    display: grid;
    gap: 1rem;
}

.choice-grid {
    display: grid;
    gap: 0.75rem;
}

.output-profile-control {
    width: 100%;
}

.output-profile-select {
    border-color: var(--film-purple);
    color: var(--title-white);
}

.output-profile-select:focus {
    border-color: var(--film-purple);
    color: var(--heading-cyan);
}

.preview-compare-toolbar {
    display: grid;
    grid-template-columns: minmax(14rem, 0.45fr) minmax(0, 1fr);
    align-items: end;
    gap: 0.75rem;
    margin-top: 1rem;
    min-width: 0;
}

.preview-size-control {
    min-width: 0;
}

.preview-action-button {
    width: 100%;
    min-width: 0;
    min-height: 2.25rem;
}

.preview-compare-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
    margin-left: 0;
    min-width: 0;
}

.preview-view-toggle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    flex: 1 1 16rem;
    min-width: 0;
    max-width: 100%;
}

.preview-view-button {
    appearance: none;
    border-radius: 0;
    border: 1px solid var(--field-gray);
    background: var(--background-black);
    color: rgba(255, 254, 220, 0.64);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.preview-view-button:hover:not(:disabled),
.preview-view-button:focus-visible:not(:disabled) {
    border-color: var(--heading-cyan);
    color: var(--title-white);
    outline: none;
}

.preview-view-button.is-active {
    border-color: var(--heading-cyan);
    color: var(--heading-cyan);
}

.preview-view-button:disabled {
    cursor: default;
    opacity: 0.52;
}

.preview-compare-stage {
    --wipe-position: 50%;
    --wipe-left: 50%;
    --wipe-right: 50%;
    position: relative;
    width: 100%;
    min-width: 0;
    height: clamp(22rem, 42vw, 34rem);
    margin-top: 0.75rem;
    border: 1px solid var(--field-gray);
    background: #000000;
    overflow: hidden;
    touch-action: none;
}

.preview-compare-image,
.preview-compare-after-layer {
    position: absolute;
    inset: 0;
}

.preview-compare-image {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: contain;
    background: #000000;
}

.preview-compare-stage.has-image .preview-compare-image {
    display: block;
}

.preview-compare-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    text-align: center;
    color: rgba(255, 254, 220, 0.56);
}

.preview-compare-stage.has-image .preview-compare-empty {
    display: none;
}

.preview-compare-after-layer {
    clip-path: inset(0 0 0 var(--wipe-left));
    overflow: hidden;
    z-index: 2;
    will-change: clip-path;
}

.preview-compare-stage[data-view-mode="before"] .preview-compare-after-layer {
    clip-path: inset(0 0 0 100%);
}

.preview-compare-stage[data-view-mode="after"] .preview-compare-after-layer {
    clip-path: inset(0 0 0 0);
}

.preview-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--wipe-left);
    transform: translateX(-50%);
    width: 3rem;
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    z-index: 3;
}

.preview-compare-divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(96, 224, 255, 0.9);
    box-shadow: 0 0 12px rgba(96, 224, 255, 0.24);
}

.preview-compare-divider-grip {
    position: relative;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid var(--heading-cyan);
    background: rgba(0, 0, 0, 0.9);
    display: grid;
    place-items: center;
    color: var(--heading-cyan);
}

.preview-compare-divider-grip::before {
    content: '<>';
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.preview-compare-divider:focus-visible {
    outline: none;
}

.preview-compare-stage[data-view-mode="before"] .preview-compare-divider,
.preview-compare-stage[data-view-mode="after"] .preview-compare-divider,
.preview-compare-stage:not(.has-image) .preview-compare-divider {
    display: none;
}

.preview-compare-corner {
    position: absolute;
    top: 0.85rem;
    z-index: 3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.2;
    color: rgba(255, 254, 220, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
}

.preview-compare-corner-before {
    left: 0.85rem;
}

.preview-compare-corner-after {
    right: 0.85rem;
}

.preview-compare-stage:not(.has-image) .preview-compare-corner {
    display: none;
}

.preview-compare-stage[data-view-mode="before"] .preview-compare-corner-after,
.preview-compare-stage[data-view-mode="after"] .preview-compare-corner-before {
    opacity: 0.4;
}

.action-button,
.modal-button {
    appearance: none;
    border-radius: 0;
    border: 1px solid var(--field-gray);
    background: var(--background-black);
    color: rgba(255, 254, 220, 0.7);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.action-button:hover,
.modal-button:hover {
    border-color: var(--heading-cyan);
    color: var(--title-white);
}

.field-group {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.field-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row > * {
    min-width: 0;
}

.field-label-with-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.field-label-with-value output {
    color: var(--title-white);
}

.field-input,
.field-select {
    width: 100%;
    background: var(--background-black);
    border: 1px solid var(--film-purple);
    border-radius: 0;
    color: var(--title-white);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 8px 12px;
    line-height: 1.2;
}

.field-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.5;
    color: rgba(255, 254, 220, 0.6);
}

.field-input:focus,
.field-select:focus {
    border-color: var(--heading-cyan);
    box-shadow: 0 0 0 1px var(--heading-cyan);
}

.field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23b40096' viewBox='0 0 16 16'%3e%3cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 12px;
    padding-right: 28px;
}

.field-select option {
    background: #101010;
    color: var(--title-white);
}

.field-range {
    appearance: none;
    width: 100%;
    height: 34px;
    margin: 0;
    background: transparent;
}

.field-range:disabled {
    opacity: 0.45;
}

.field-range::-webkit-slider-runnable-track {
    height: 2px;
    background: rgba(180, 0, 150, 0.75);
}

.field-range::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -6px;
    border: 1px solid var(--film-purple);
    background: var(--title-white);
}

.field-range::-moz-range-track {
    height: 2px;
    background: rgba(180, 0, 150, 0.75);
}

.field-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 1px solid var(--film-purple);
    background: var(--title-white);
}

.summary-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.6;
    color: rgba(255, 254, 220, 0.6);
}

.summary-note:empty {
    display: none;
}

.action-stack {
    display: grid;
    gap: 0.75rem;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.action-button {
    text-align: center;
    color: var(--heading-cyan);
    border-color: var(--heading-cyan);
}

.action-button[disabled] {
    border-color: var(--field-gray);
    color: rgba(255, 254, 220, 0.35);
    cursor: not-allowed;
}

.action-button.secondary {
    border-color: var(--field-gray);
    color: rgba(255, 254, 220, 0.7);
}

.progress-container {
    display: none;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-container.is-active {
    display: flex;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #222;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--film-purple), var(--heading-cyan));
    transition: width 0.3s ease;
}

.progress-percentage {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--heading-cyan);
    min-width: 50px;
    text-align: right;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 2rem;
    margin-bottom: 1rem;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.progress-label {
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}

.progress-value {
    color: var(--title-white);
    font-family: 'JetBrains Mono', monospace;
}

.upscaler-progress-details {
    grid-template-columns: 1fr;
}

.activity-log {
    background: #000;
    border: 1px solid var(--field-gray);
    padding: 0.75rem;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--title-white);
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.log-line {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-timestamp {
    color: var(--heading-cyan);
}

.log-timestamp.success {
    color: var(--success-green);
}

.log-timestamp.error {
    color: var(--error-red);
}

.activity-log::-webkit-scrollbar {
    width: 10px;
}

.activity-log::-webkit-scrollbar-track {
    background: #000;
    border-left: 1px solid #333;
}

.activity-log::-webkit-scrollbar-thumb {
    background: var(--film-purple);
    border-radius: 0;
}

.activity-log::-webkit-scrollbar-thumb:hover {
    background: #d400b0;
}

.activity-log {
    scrollbar-width: thin;
    scrollbar-color: var(--film-purple) #000;
}

.log-line.error {
    color: var(--error-red);
}

.download-actions {
    display: none;
    margin-top: 1rem;
}

.download-actions.is-visible {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.notification-container {
    position: fixed;
    top: calc(1rem + 1.9rem + 1rem + 1px);
    left: 150px;
    right: 150px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    pointer-events: none;
}

.toast-notification {
    background: transparent;
    color: var(--title-white);
    padding: 0 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    will-change: opacity, transform, max-height, margin-bottom, padding;
    transition:
        opacity 220ms ease,
        transform 220ms ease,
        max-height 320ms ease,
        margin-bottom 320ms ease,
        padding-top 320ms ease,
        padding-bottom 320ms ease;
    pointer-events: auto;
    width: min(420px, 100%);
    text-align: right;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 2.4rem;
    margin-bottom: 0.2rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.toast-notification.success {
    color: var(--title-white);
}

.toast-notification.error {
    color: var(--error-red);
}

.toast-notification.warning {
    color: #ff8a00;
}

.modal-shell {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.84);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1400;
}

.modal-shell.is-open {
    display: flex;
}

.modal-card {
    width: min(56rem, calc(100vw - 4rem));
    border: 1px solid var(--field-gray);
    background: var(--background-black);
    padding: 1rem 1.5rem 1.5rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-button {
    text-align: center;
}

.modal-button.primary {
    border-color: var(--heading-cyan);
    color: var(--heading-cyan);
}

.modal-button.crypto {
    border-color: var(--film-purple);
    color: var(--film-purple);
}

.icon-close-button {
    width: 2.25rem;
    min-width: 0;
    height: 2.25rem;
    justify-self: end;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--film-purple);
    text-align: center;
}

.icon-close-button:hover,
.icon-close-button:focus-visible {
    color: var(--heading-cyan);
}

.crypto-qr {
    margin: 1rem auto 0;
    display: grid;
    place-items: center;
    min-height: 16rem;
    border: 1px solid var(--field-gray);
    background: #050505;
    padding: 1rem;
}

.crypto-qr canvas,
.crypto-qr img {
    max-width: 100%;
    height: auto;
}

.crypto-qr-empty {
    font-family: 'FilmProcessorFavorit', sans-serif;
    font-size: 1rem;
    color: var(--title-white);
    text-align: center;
    line-height: 1.5;
}

.crypto-code {
    width: 100%;
    margin-top: 1rem;
}

.crypto-code textarea {
    width: 100%;
    min-height: 6.5rem;
    resize: none;
    line-height: 1.55;
}

.hidden {
    display: none !important;
}

.section-title-with-icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compatibility-atlas-link {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--film-purple);
    text-decoration: none;
    transition: color 0.2s ease;
    transform: translateX(3px);
}

.compatibility-atlas-link:hover {
    color: var(--heading-cyan);
}

.video-player-section {
    display: none;
    margin-top: 1rem;
}

.video-player-section.is-visible {
    display: block;
}

.tc-section {
    margin-top: 1rem;
}

.tc-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.tc-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.tc-input-wrapper input {
    width: 100%;
    padding-right: 30px;
}

.tc-reset-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--film-purple);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.7;
}

.tc-reset-btn:hover {
    opacity: 1;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

.settings-grid > * {
    min-width: 0;
}

.settings-panel {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 8;
}

.settings-panel .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    min-height: 2.45rem;
    border-bottom: 1px solid #222;
    font-size: 0.8rem;
}

.settings-panel .summary-row:last-of-type {
    border-bottom: none;
}

.settings-panel .summary-label {
    flex: 0 0 auto;
    padding-right: 0.75rem;
    color: var(--title-white);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
}

.settings-panel .summary-value {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
    color: var(--heading-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
    .upscaler-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .preview-compare-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-compare-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .preview-view-toggle {
        flex: 1 1 16rem;
        min-width: min(100%, 16rem);
    }

    .preview-action-button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 1360px) {
    .preview-compare-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .field-row,
    .processing-choice,
    .modal-actions,
    .download-actions.is-visible {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .tc-row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 2rem 4rem;
    }

    .notification-container {
        top: calc(1.5rem + 1.9rem + 1rem + 1px);
        left: 2rem;
        right: 2rem;
    }

    .toast-notification {
        width: 100%;
    }

    .video-main-controls {
        gap: 10px;
    }

    .video-time-display {
        min-width: auto;
        font-size: 0.6rem;
    }

    .volume-slider {
        display: none;
    }

    .preview-compare-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-compare-toolbar {
        grid-template-columns: 1fr;
    }

    .preview-view-toggle {
        min-width: 0;
    }

    .preview-action-button {
        width: 100%;
    }

    .icon-close-button {
        width: 2.25rem;
    }
}
