.edit-note {
    margin-top: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
}

:root {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.5;
    color: #1f2933;
    background-color: #dbe2ef;
}

:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #0f172a url('../images/PdfMergeBackground.png') center/cover fixed no-repeat;
    color: inherit;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 24, 0.4);
    pointer-events: none;
    z-index: -1;
}

.app-shell {
    max-width: 840px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

header {
    text-align: center;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.25rem;
    max-width: 620px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
}

header h1 {
    margin: 0 0 0.35rem;
}

.tagline {
    margin: 0;
    color: #3f4d63;
}

.top-nav {
    margin-top: 0.85rem;
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.top-nav a {
    text-decoration: none;
    color: #1d4d8b;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.top-nav a.active,
.top-nav a:hover {
    background-color: rgba(37, 99, 235, 0.12);
    color: #0f172a;
}

main {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1rem;
    padding: 2.25rem;
    box-shadow: 0 28px 65px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.info-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
}

.info-card h2 {
    margin-top: 0;
    color: #111827;
}

.info-card p {
    color: #475569;
    line-height: 1.6;
}

.intro {
    margin-bottom: 1.5rem;
}

.local-only {
    font-weight: 600;
    color: #0f766e;
}

.picker {
    border: 2px dashed rgba(99, 102, 241, 0.45);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background-color: #f7f8ff;
}

.picker input[type="file"] {
    width: 100%;
}

.summary {
    display: flex;
    justify-content: space-between;
    background: #edf2ff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.drag-hint {
    margin: 0 0 0.75rem;
    color: #475569;
    font-size: 0.9rem;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    user-select: none;
    -webkit-user-select: none;
}

.file-list * {
    user-select: none;
    -webkit-user-select: none;
}

.file-list li {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
    cursor: grab;
    transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: none;
}

@keyframes drag-float {
    from {
        transform: scale(1.02) translateY(-2px);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    }
    to {
        transform: scale(1.05) translateY(-6px);
        box-shadow: 0 20px 30px rgba(15, 23, 42, 0.25);
    }
}

.file-list li.dragging {
    opacity: 0.9;
    cursor: grabbing;
    border-style: dashed;
    animation: drag-float 0.45s ease-in-out infinite alternate;
}

.file-list li.drag-target {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.file-list li.drag-target::before {
    content: "";
    display: block;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    opacity: 0.85;
    margin-bottom: 0.35rem;
}

.file-list li > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-list li strong {
    display: block;
}

.file-order {
    margin-right: 0.35rem;
    color: #1d4ed8;
}

.file-list li span {
    color: #64748b;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
}

.actions button {
    margin-left: 0;
}

.actions.primary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

button.primary {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
}

button.primary:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #ecfccb;
    color: #3f6212;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.preview-frame {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8fafc;
}

.preview-frame iframe {
    width: 100%;
    height: 260px;
    border: none;
}

.preview.loading {
    color: #0f172a;
    font-size: 0.9rem;
}

.preview.error {
    color: #b91c1c;
    font-size: 0.9rem;
}

.drag-status {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    padding: 0.4rem 0.75rem;
    border-radius: 0.45rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.skip-link {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -110%);
    background: #2563eb;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 20%);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-weight: 600;
}

.form-field input,
.form-field textarea {
    padding: 0.65rem 0.75rem;
    border: 1px solid #cbd5f5;
    border-radius: 0.5rem;
    font-size: 1rem;
    background: #fff;
}

.form-field textarea {
    resize: vertical;
}

.contact-form .primary {
    align-self: flex-start;
}

.consent-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65); /* semi-transparent dark backdrop */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.consent-modal {
    max-width: 420px;
    width: 90%;
    background: #0b1120;
    color: #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    padding: 1.5rem 1.75rem;
}

.consent-modal h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.consent-modal p {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.consent-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.consent-actions .primary {
    padding: 0.4rem 0.9rem;
}

.consent-actions .secondary {
    padding: 0.4rem 0.9rem;
    background: transparent;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

@media (max-width: 640px) {
    main {
        padding: 1.25rem;
    }

    .summary {
        flex-direction: column;
        gap: 0.35rem;
    }

    .file-list {
        grid-template-columns: 1fr;
    }

    .actions button {
        margin-top: 0.35rem;
    }
}
