:root {
    --ink: #28293D;
    --shadow: #4D4D66;
    --muted: #707070;
    --line: #28293D;
    --line-soft: #D5D6DE;
    --surface: #FFFFFF;
    --canvas: #F4F5F8;
    --accent: #FA4949;
    --accent-dark: #E03535;
    --accent-soft: #FDECEC;
    --link: #0D6EFD;
    --select: #8DB9FF;
    --mark: #FFE066;
    --danger: #FA4949;
    --accent-red: #FA4949;
    --accent-red-hover: #E03535;
    --accent-red-soft: #FDECEC;
    --warn-bg: #FFF7E0;
    --warn-ink: #6B4500;
    --header-h: 60px;
    --panel-w: 400px;

    --bs-body-font-family: "Fragment Mono", "Courier New", Courier, monospace;
    --bs-body-color: var(--ink);
    --bs-body-bg: #FFFFFF;
    --bs-border-color: var(--line-soft);
    --bs-link-color-rgb: 13, 110, 253;
    --bs-link-hover-color-rgb: 10, 88, 202;
    --bs-focus-ring-color: rgba(250, 73, 73, .25);
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
}

html,
body {
    height: 100%;
}

body {
    background: var(--surface);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    color: #fff;
    background: var(--select);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

a {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-style: solid;
}

.text-muted-2 {
    color: var(--muted);
}

.btn,
.form-control,
.form-select,
.alert {
    border-radius: 0;
}

.form-control,
.form-select {
    border-color: var(--line);
    color: var(--ink);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
}

.form-check-input {
    border-color: var(--line);
    border-radius: 0 !important;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.retrobox {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: 3px 3px var(--shadow);
}


.site-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 24px;
    background: var(--surface);
}

body.state-upload .site-header {
    max-width: 948px;
    margin: 0 auto;
    padding-top: 12px;
    height: calc(var(--header-h) + 12px);
}

body.state-editor .site-header {
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    margin-right: auto;
}

body.state-upload div.brand {
    cursor: default;
}

a.brand,
body.state-upload a.brand,
body.state-editor .brand {
    cursor: pointer;
}

a.brand:hover,
body.state-editor .brand:hover {
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-size: 18px;
    letter-spacing: .02em;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--link);
}

.site-nav a:hover {
    color: var(--link);
    text-decoration-style: solid;
}

body.state-editor .site-nav {
    display: none;
}

.header-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
}

.header-file .btn-link {
    color: var(--link);
    font: inherit;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    padding: 0;
    white-space: nowrap;
    transition: color 150ms ease;
}

.header-file .btn-link:hover,
.header-file .btn-link:focus-visible {
    color: var(--link);
    text-decoration-style: solid;
}

.upload-view {
    max-width: 948px;
    margin: 0 auto;
    padding: 16px 24px 32px;
}

h1,
h2,
h3,
.upload-view h1,
.upload-view h2,
.upload-view h3 {
    text-transform: capitalize;
    font-weight: 400;
}

h1,
.upload-view h1 {
    font-size: clamp(1.9rem, 4.6vw, 2.6rem);
    line-height: 1.2;
    letter-spacing: .01em;
    margin: 2.25rem 0 1.25rem;
    max-width: 100%;
}

.hero-accent,
.text-accent-bg {
    background-color: var(--accent);
    color: #fff;
    padding: 2px 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

h2,
.upload-view h2 {
    font-size: 2rem;
    margin: 4rem 0 1.75rem;
}

.intro {
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    padding: 28px;
    cursor: pointer;
    user-select: none;
    background: var(--canvas);
    border: 2px dashed var(--line);
    box-shadow: none;
    color: var(--ink);
    transition: border-color 150ms ease, background-color 150ms ease;
}

.dropzone:hover {
    border-color: var(--link);
    background: #EBF3FF;
}

.dropzone.is-over {
    border-color: var(--link);
    background: #DCE8FC;
}

.dropzone:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.dropzone-idle,
.dropzone-busy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.dropzone-busy {
    display: none;
    flex-direction: row;
    gap: 10px;
    color: var(--muted);
}

.dropzone.is-busy {
    cursor: progress;
}

.dropzone.is-busy .dropzone-idle {
    display: none;
}

.dropzone.is-busy .dropzone-busy {
    display: flex;
}

.dropzone-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.dropzone-sub {
    color: var(--muted);
}

.link-like {
    color: var(--link);
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.dropzone:hover .link-like,
.link-like:hover {
    text-decoration-style: solid;
}

.upload-error {
    margin-top: 1.25rem;
    border: 1px solid var(--accent-red);
    background: var(--accent-red-soft);
    color: #8F1D1D;
}

.license {
    margin: 1.5rem 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.feature {
    box-shadow: 3px 3px var(--accent);
    padding: 1.5rem;
}

.feature h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 .6rem;
}

.feature p {
    margin: 0;
    font-size: .92rem;
}

.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.steps li {
    counter-increment: step;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.steps li::before {
    content: counter(step);
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    box-shadow: 2px 2px var(--accent);
    transform: translateY(-2px);
}

.steps strong {
    font-weight: 700;
}

.faq {
    border: 1px solid var(--line);
    margin-bottom: 1.25rem;
}

.faq summary:hover {
    color: var(--link);
}

.faq summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem .9rem;
    font-weight: 400;
    cursor: pointer;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin: .2rem .3rem 0 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s;
}

.faq summary:hover::after {
    color: var(--link);
}

.faq[open] summary {
    background: #F8F9FA;
    border-bottom: 1px solid var(--line);
}

.faq[open] summary::after {
    transform: rotate(225deg);
    margin-top: .5rem;
}

.faq p {
    margin: 0;
    padding: 1rem .9rem 1.1rem;
    font-size: .92rem;
}

.disclaimer {
    color: var(--muted);
    font-size: .85rem;
    margin-top: 3rem;
}

.upload-view .disclaimer h2,
.disclaimer h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 .5rem;
}

.disclaimer p {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.5;
    margin: 0;
}

.site-footer {
    max-width: 948px;
    margin: 0 auto;
    padding: 2rem 24px 3rem;
    font-size: .92rem;
}

.site-footer .legal {
    color: var(--muted);
    font-size: .8rem;
    margin-top: 1.5rem;
}

body.state-editor .site-footer {
    display: none;
}

.legal-content section {
    margin-bottom: 2.75rem;
}

.legal-content h1 {
    font-size: 1.85rem;
    margin-bottom: 1.25rem;
    color: var(--ink);
}

.legal-content h2 {
    font-size: 1.45rem;
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    color: var(--ink);
}

.legal-content p,
.legal-content li {
    line-height: 1.75;
    color: var(--ink);
}


body.state-editor {
    overflow: hidden;
    background: var(--canvas);
}

.editor-view {
    height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
}

.editor-view[hidden] {
    display: none;
}

.ocr-progress-view {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--canvas);
}

.ocr-progress-view[hidden] {
    display: none !important;
}

.ocr-progress {
    width: 100%;
    max-width: 560px;
    padding: 2rem 2.25rem 1.75rem;
}

.ocr-progress-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ocr-progress-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    padding: 4px 10px;
}

.ocr-progress-filename {
    color: var(--muted);
    font-size: .85rem;
    max-width: 250px;
}

.ocr-progress-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: .01em;
    margin: 0 0 .5rem;
    color: var(--ink);
}

.ocr-progress-text {
    font-size: .95rem;
    line-height: 1.55;
    color: var(--ink);
    margin: 0 0 1.5rem;
}

.ocr-progress-track {
    height: 16px;
    margin: 0 0 .75rem;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 2px 2px var(--shadow);
}

.ocr-progress-fill {
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width .3s ease;
}

.ocr-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: .85rem;
}

.ocr-progress-elapsed {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ink);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-group[hidden] {
    display: none !important;
}

.tool-right {
    margin-left: auto;
    gap: 12px;
}

.btn {
    white-space: nowrap;
}

.btn-tool {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: .95rem;
    line-height: 1;
    box-shadow: 2px 2px var(--shadow);
}

.btn-tool:hover {
    border-color: var(--line);
    color: var(--ink);
    background: var(--canvas);
}

.btn-tool:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px var(--shadow);
}

.btn-tool:disabled {
    color: #A5A7B5;
    border-color: #C5C7D2;
    box-shadow: 2px 2px #D5D6DE;
    background: var(--surface);
}

.zoom-label {
    font-size: .85rem;
    min-width: 64px;
}

.page-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    margin: 0 4px;
}

#pageInput {
    width: 3.4em;
    height: 34px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 0;
    font: inherit;
}

#pageInput:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
}

.find-group {
    gap: 8px;
}

.find-group .form-control {
    width: 160px;
    height: 34px;
    font-size: .88rem;
}

.find-count {
    color: var(--muted);
    font-size: .82rem;
    min-width: 6em;
}

.btn-accent,
.btn-outline-accent {
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line);
    box-shadow: 3px 3px var(--shadow);
}

.btn-accent {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
    box-shadow: 3px 3px var(--shadow);
}

.btn-accent:hover,
.btn-accent:focus-visible {
    background: var(--canvas);
    color: var(--ink);
    border-color: var(--line);
}

.btn-accent:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px var(--shadow);
}

.btn-accent:disabled {
    background: var(--surface);
    border-color: #C5C7D2;
    color: #A5A7B5;
    box-shadow: 3px 3px #D5D6DE;
    opacity: 1;
}

.btn-delete-server {
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line);
    background: var(--accent);
    color: #fff;
    box-shadow: 3px 3px var(--shadow);
    font-size: .88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}

.btn-delete-server:hover,
.btn-delete-server:focus-visible {
    background: var(--accent-dark);
    color: #fff;
    border-color: var(--line);
}

.btn-delete-server:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px var(--shadow);
}

.btn-delete-server:disabled {
    background: #F5A3A3;
    border-color: #E28F8F;
    color: #fff;
    box-shadow: 3px 3px #D5D6DE;
    opacity: 1;
    cursor: not-allowed;
}

.btn-outline-accent {
    height: 34px;
    background: var(--surface);
    color: var(--ink);
    font-size: .88rem;
    box-shadow: 2px 2px var(--shadow);
}

.btn-outline-accent:hover {
    color: var(--ink);
    border-color: var(--line);
    background: var(--canvas);
}

.btn-outline-accent:disabled {
    color: #A5A7B5;
    border-color: #C5C7D2;
    box-shadow: 2px 2px #D5D6DE;
    opacity: 1;
}

.compare-btn {
    font-size: .88rem;
    padding: 0 12px;
}

.compare-btn[aria-pressed="true"] {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

.compare-btn[aria-pressed="true"]:hover {
    background: var(--canvas);
    color: var(--ink);
    border-color: var(--line);
}

.workspace {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.page-scroller {
    flex: 1 1 auto;
    overflow: auto;
    padding: 32px;
    background: var(--canvas);
}

.page-frame {
    position: relative;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 4px 4px var(--shadow);
    box-sizing: content-box;
}

.page-frame canvas {
    display: block;
}

.page-frame.is-original::after {
    content: "Original";
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    background: var(--ink);
    color: #fff;
    font-size: .75rem;
}

.page-hint {
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    margin: 18px 0 0;
}

.page-hint:empty {
    display: none;
}

.page-hint.is-busy::before {
    content: "";
    display: inline-block;
    width: .8em;
    height: .8em;
    margin-right: .6em;
    vertical-align: -1px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ptr-spin .8s linear infinite;
}

@keyframes ptr-spin {
    to {
        transform: rotate(360deg);
    }
}

.overlay-layer {
    position: absolute;
    inset: 0;
}

.text-box {
    position: absolute;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: text;
}

.text-box:hover {
    outline: 1.5px solid var(--select);
    background: rgba(141, 185, 255, .15);
}

.text-box.is-ocr:hover {
    outline-style: dashed;
}

.text-box.is-edited {
    background: var(--mark);
    mix-blend-mode: multiply;
    opacity: .6;
}

.text-box.is-edited:hover {
    opacity: .75;
}

.text-box.is-active {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.text-box.is-locked {
    cursor: not-allowed;
}

.text-box.is-locked:hover {
    outline: 1.5px dashed var(--accent-red);
    background: rgba(250, 73, 73, .08);
}

.text-box.is-match {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.text-box:focus-visible {
    outline: 2px solid var(--accent);
}

.page-frame.is-original .text-box.is-edited {
    background: transparent;
}

.edit-panel {
    flex: 0 0 var(--panel-w);
    width: var(--panel-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--line);
    min-height: 0;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    font-size: 1.05rem;
    font-weight: 400;
    margin: 0;
}

.edit-count {
    color: var(--muted);
    margin-left: 4px;
}

.preview-status {
    font-size: .78rem;
    color: var(--muted);
}

.preview-status.is-error {
    color: var(--danger);
}

.panel-empty {
    padding: 20px;
    font-size: .9rem;
}

.edit-list {
    overflow-y: auto;
    flex: 1 1 auto;
}

.edit-card {
    padding: 16px 20px 18px;
    border-bottom: 1px solid var(--line-soft);
    border-left: 4px solid transparent;
}

.edit-card.is-active {
    border-left-color: var(--accent);
    background: #FAFBFD;
}

.edit-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.edit-meta .btn-link {
    font-size: .78rem;
    color: var(--link);
    text-decoration: underline;
}

.edit-meta .edit-remove {
    font-size: .78rem;
    color: var(--accent-red);
    text-decoration: none;
    transition: color 150ms ease;
}

.edit-meta .edit-remove:hover {
    color: var(--accent-red-hover);
    text-decoration: underline;
}

.edit-meta .meta-page {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.edit-meta .meta-page:hover {
    color: var(--link);
    text-decoration: underline;
}

.meta-font {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.edit-original {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.edit-card.is-changed .edit-original {
    text-decoration: line-through;
    text-decoration-color: var(--accent-red);
}

.edit-input {
    font-size: .95rem;
    box-shadow: 2px 2px var(--shadow);
}

.edit-input:focus {
    box-shadow: 2px 2px var(--accent-dark), 0 0 0 3px var(--bs-focus-ring-color);
}

.edit-options,
.ocr-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    font-size: .82rem;
}

.ocr-options[hidden] {
    display: none;
}

.opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.opt[hidden] {
    display: none;
}

.opt .form-select {
    width: auto;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: .82rem;
}

.opt-check .form-check-input {
    margin: 0;
}

.opt-font {
    flex: 1 1 auto;
    min-width: 0;
}

.opt-font .form-select {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.edit-size {
    width: 5em;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: .82rem;
}

.edit-actions {
    margin-top: 12px;
}

.btn-delete {
    height: 32px;
    padding: 0 14px;
    font-size: .84rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--line);
    box-shadow: 2px 2px var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}

.btn-delete:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-delete:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px var(--shadow);
}

.btn-delete:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.edit-warning {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #E3C97A;
    background: var(--warn-bg);
    color: var(--warn-ink);
    font-size: .8rem;
}

.edit-warning:empty {
    display: none;
}

.edit-warning code {
    color: inherit;
    font-size: 1em;
    background: rgba(107, 69, 0, .1);
    padding: 0 4px;
}

.ocr-note {
    margin: 12px 0 0;
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.5;
}

.edit-card.is-locked {
    border-left-color: var(--accent-red);
}

.edit-card.is-locked .edit-input,
.edit-card.is-locked .edit-options,
.edit-card.is-locked .ocr-options {
    display: none;
}


@media (max-width: 900px) {
    :root {
        --panel-w: 100%;
    }

    body.state-editor {
        overflow: auto;
    }

    .editor-view {
        height: auto;
    }

    .workspace {
        flex-direction: column;
    }

    .page-scroller {
        padding: 16px;
        max-height: 70vh;
    }

    .edit-panel {
        flex: 0 0 auto;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .edit-list {
        overflow: visible;
    }

    .tool-right {
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }

    body.state-upload .site-header {
        height: auto;
        min-height: calc(var(--header-h) + 12px);
        flex-wrap: wrap;
        row-gap: 8px;
        padding-bottom: 8px;
    }

    body.state-upload .site-nav {
        flex: 0 0 100%;
        flex-wrap: wrap;
        gap: 4px 20px;
    }

    body.state-upload .site-nav a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    h2,
    .upload-view h2 {
        font-size: 1.6rem;
        margin-top: 3rem;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 0 14px;
        gap: 1rem;
    }

    body.state-editor .brand-name {
        display: none;
    }

    .file-name {
        max-width: 45vw;
    }

    .toolbar {
        padding: 8px 12px;
        gap: 8px 12px;
    }

    .find-group {
        flex: 1 1 100%;
        order: 3;
        min-width: 0;
    }

    .find-group .form-control {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .find-count {
        display: none;
    }

    .tool-right {
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    .upload-view {
        padding: 8px 16px 24px;
    }

    .site-footer {
        padding: 1.5rem 16px 2.5rem;
    }

    .ocr-progress {
        padding: 1.5rem 1.25rem;
    }

    .ocr-progress-filename {
        max-width: 140px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
