* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #101014;
    --card: #1a1a21;
    --text: #e8e8ee;
    --muted: #b2b2c2;
    --line: #373748;
    --primary: #3f7eb8;
    --primary-hover: #32628f;
    --success-bg: #1a3523;
    --success-text: #9de3b0;
    --success-line: #2f5b3d;
    --error-bg: #3a1d24;
    --error-text: #ffb2c2;
    --error-line: #6f3340;
}

body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    min-height: 100vh;
    color: var(--text);
    background: #101014;
}

.site-page {
    position: relative;
    background: #05080c;
}

.site-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    background: #05080c;
}

.site-background-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transform: scale(1.03);
}

.site-background-layer.is-visible {
    opacity: 1;
}

.overlay {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 28px 14px;
}

.page-shell {
    width: min(700px, 100%);
    display: grid;
    gap: 14px;
}

.content {
    width: min(700px, 100%);
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 4px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.brand-inline-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.brand-inline-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-title-row .title {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .brand-inline-logo {
        width: 28px;
        height: 28px;
    }

    .brand-title-row {
        gap: 8px;
    }
}

.header {
    margin-bottom: 16px;
    text-align: left;
}

.title {
    font-size: clamp(1.7rem, 5vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.subtitle {
    font-size: 0.98rem;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 6px;
}

.small-note {
    font-size: 0.82rem;
    color: #8e8ea3;
}

.upload-box {
    margin-bottom: 16px;
}

.drop-zone {
    border: 2px dashed #6c6c80;
    border-radius: 4px;
    padding: 20px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    background: #14141b;
    margin-bottom: 16px;
    display: block;
    text-align: center;
}

.drop-zone:hover {
    border-color: #9494ac;
}

.drop-zone.hover {
    background: #1c1c27;
    border-color: #a6a6c2;
}

.upload-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    color: #c7c7db;
}

.drop-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.drop-hint {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 6px;
}

.selected-file {
    margin-top: 10px;
    font-size: 0.86rem;
    color: #ccccda;
    font-weight: 400;
    word-break: break-word;
}

.button-group {
    display: flex;
    justify-content: flex-start;
}

.btn {
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid #2a5074;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.06s ease;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result {
    min-height: 24px;
    display: grid;
    gap: 10px;
}

.result-card {
    border-radius: 4px;
    border: 1px solid var(--line);
    background: #14141b;
    padding: 12px;
}

.result-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #dddded;
}

.result-link-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.result-link {
    flex: 1;
    min-width: 220px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #0f0f15;
    padding: 8px 10px;
    font-size: 0.88rem;
    color: #f0f0fb;
}

.btn-copy {
    border: 1px solid #666681;
    background: #222231;
    color: #ececf8;
    border-radius: 3px;
    padding: 8px 10px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-copy:hover {
    background: #2c2c3e;
}

.status {
    border-radius: 6px;
    border: 1px solid var(--line);
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 400;
}

.status.success {
    border-color: var(--success-line);
    background: var(--success-bg);
    color: var(--success-text);
}

.status.error {
    border-color: var(--error-line);
    background: var(--error-bg);
    color: var(--error-text);
}

.status.info {
    background: #182334;
    border-color: #2b4467;
    color: #b7d2ff;
}

.legal-overlay {
    align-items: stretch;
    padding-top: 24px;
    padding-bottom: 40px;
}

.legal-content {
    width: min(900px, 100%);
    background: rgba(26, 26, 33, 0.86);
    backdrop-filter: blur(8px);
}

.site-footer {
    display: grid;
    gap: 8px;
    text-align: center;
    background: rgba(26, 26, 33, 0.9);
}

.site-footer p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.site-footer strong {
    color: var(--text);
}

.site-footer a {
    color: #9bc9ff;
    text-decoration: none;
}

.site-footer a:hover {
    color: #c4e0ff;
    text-decoration: underline;
}

.legal-header {
    margin-bottom: 22px;
}

.legal-kicker {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 9px;
    border: 1px solid #44637d;
    border-radius: 999px;
    background: #13202d;
    color: #bfdcff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.brand-kicker-row .legal-kicker {
    margin-bottom: 0;
}

.legal-back-link {
    margin-top: 12px;
}

.legal-back-link a,
.legal-toc a {
    color: #9bc9ff;
    text-decoration: none;
}

.legal-back-link a:hover,
.legal-toc a:hover {
    color: #c4e0ff;
    text-decoration: underline;
}

.legal-contact-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid rgba(232, 232, 238, 0.4);
}

.legal-contact-link:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.85);
}

.legal-contact-link:visited {
    color: var(--text);
}

.legal-toc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    padding: 14px;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #14141b;
}

.legal-toc a {
    font-size: 0.92rem;
    line-height: 1.4;
}

.legal-section {
    padding: 18px 0;
    border-top: 1px solid #2a2a38;
}

.legal-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.legal-section h2 {
    margin-bottom: 12px;
    font-size: clamp(1.05rem, 2.6vw, 1.3rem);
    line-height: 1.35;
}

.legal-section p {
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-list {
    margin: 0 0 14px 20px;
    color: var(--text);
}

.legal-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.legal-list-danger li::marker {
    color: #ff8ea2;
}

@media (max-width: 600px) {
    .overlay {
        padding: 10px;
    }

    .content {
        padding: 14px;
        border-radius: 6px;
    }

    .page-shell {
        gap: 10px;
    }

    .drop-zone {
        padding: 16px 10px;
    }

    .button-group {
        display: block;
    }

    .btn {
        width: 100%;
    }

    .legal-toc {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .legal-section {
        padding: 16px 0;
    }

    .legal-content {
        backdrop-filter: blur(6px);
    }
}