* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #101419;
    --card: rgba(23, 29, 37, 0.9);
    --card-strong: #171d25;
    --text: #eef2f7;
    --muted: #b4bfcc;
    --line: #334254;
    --line-soft: #2a3544;
    --primary: #3f7298;
    --primary-hover: #4c84ad;
    --primary-soft: #203246;
    --success-bg: #1c3328;
    --success-text: #abd9bc;
    --success-line: #39604a;
    --error-bg: #3a1f26;
    --error-text: #f2c0c9;
    --error-line: #6e3a45;
}

body {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    line-height: 1.45;
}

.site-page {
    position: relative;
    background:
        radial-gradient(900px 500px at 12% -10%, rgba(79, 123, 158, 0.22), transparent 60%),
        radial-gradient(700px 400px at 90% 0%, rgba(52, 84, 115, 0.22), transparent 58%),
        linear-gradient(160deg, #0d1117 0%, #101419 52%, #111823 100%);
}

.site-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(160deg, #0d1117 0%, #101419 52%, #111823 100%);
}

.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: 34px 14px;
}

.page-shell {
    width: min(860px, 100%);
    display: grid;
    gap: 16px;
}

.content {
    width: min(860px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 45px rgba(6, 10, 16, 0.35);
    backdrop-filter: blur(10px);
}

.content::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.035);
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.brand-inline-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    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: 20px;
    text-align: left;
}

.title {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: clamp(1.9rem, 5vw, 2.35rem);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.subtitle {
    font-size: 1.01rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 8px;
    max-width: 65ch;
}

.small-note {
    font-size: 0.9rem;
    color: #9bacbf;
}

.upload-box {
    margin-bottom: 10px;
}

.drop-zone {
    border: 1px dashed #647992;
    border-radius: 12px;
    padding: 20px 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    background: linear-gradient(145deg, rgba(20, 30, 41, 0.95), rgba(18, 24, 34, 0.95));
    margin-bottom: 14px;
    display: block;
    text-align: center;
}

.file-input {
    display: none;
}

.drop-zone:hover {
    border-color: #88a4c0;
}

.drop-zone.hover {
    background: linear-gradient(145deg, rgba(31, 43, 57, 0.97), rgba(20, 29, 39, 0.98));
    border-color: #a8c2dd;
    transform: translateY(-1px);
}

.upload-icon {
    width: 34px;
    height: 34px;
    margin-bottom: 11px;
    color: #c0d6eb;
}

.drop-text {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
}

.drop-hint {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 6px;
}

.drop-hint-link {
    background: none;
    border: none;
    color: #d7e8f9;
    font: inherit;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
}

.drop-hint-link:hover {
    color: #f0f7ff;
    text-decoration: none;
}

.drop-hint-link strong {
    font-weight: 700;
}

.selected-file {
    margin-top: 11px;
    font-size: 0.88rem;
    color: #ccdaea;
    font-weight: 400;
    word-break: break-word;
}

.files-list {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    gap: 4px;
}

.file-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.file-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-word;
    line-height: 1.2;
}

.file-size {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.file-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-progress {
    position: relative;
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: rgba(116, 144, 171, 0.24);
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #5c8fbf 0%, #7bb4de 100%);
    transition: width 0.2s ease;
}

.file-progress-label {
    font-size: 0.72rem;
    color: #a8c4df;
    min-width: 34px;
    text-align: right;
}

.file-remove-btn {
    background: none;
    border: none;
    color: #f2c0c9;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.file-remove-btn:hover {
    background: rgba(242, 192, 201, 0.1);
    color: #ff8a9a;
}

.button-group {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.upload-activity {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid #2f4257;
    background: rgba(21, 30, 41, 0.78);
}

.upload-activity-text {
    font-size: 0.82rem;
    color: #9db4ca;
    white-space: nowrap;
}

.upload-activity-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
}

.upload-activity-bars span {
    width: 3px;
    height: 4px;
    border-radius: 999px;
    background: #6f9ec7;
    transform-origin: bottom;
    opacity: 0.45;
}

.upload-activity.active {
    border-color: #4f7092;
    background: rgba(22, 36, 52, 0.9);
}

.upload-activity.active .upload-activity-text {
    color: #c7ddf3;
}

.upload-activity.active .upload-activity-bars span {
    opacity: 1;
    animation: upload-bars 0.8s ease-in-out infinite;
}

.upload-activity.active .upload-activity-bars span:nth-child(2) {
    animation-delay: 0.12s;
}

.upload-activity.active .upload-activity-bars span:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes upload-bars {
    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1.4);
    }
}

.btn {
    padding: 10px 15px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid #2f4f6b;
    border-radius: 9px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.08s ease;
    font-family: inherit;
    text-decoration: none;
}

.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: 14px;
    border: 1px solid #34485e;
    background: linear-gradient(180deg, rgba(24, 34, 47, 0.96), rgba(18, 24, 33, 0.98));
    padding: 14px;
    box-shadow: 0 14px 30px rgba(6, 10, 16, 0.22);
}

.result-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #eef4fb;
}

.result-link-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}

.result-link {
    flex: 1;
    min-width: 220px;
    width: 100%;
    border: 1px solid #4c647c;
    border-radius: 10px;
    background: rgba(16, 22, 30, 0.9);
    padding: 10px 12px;
    font-size: 0.92rem;
    color: #f1f7ff;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.result-link:hover {
    border-color: #6f8fab;
    background: rgba(22, 31, 43, 0.95);
    transform: translateY(-1px);
}

.btn-copy {
    border: 1px solid #55708c;
    background: linear-gradient(180deg, #243343, #1d2732);
    color: #e8f1fb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-copy:hover {
    background: linear-gradient(180deg, #2d3f52, #233140);
    border-color: #6a85a2;
    transform: translateY(-1px);
}

.btn-copy:active {
    transform: translateY(0);
}

.status {
    border-radius: 9px;
    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: #1a2737;
    border-color: #3a5678;
    color: #c7ddf7;
}

.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(20, 27, 35, 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: #a8d0fb;
    text-decoration: none;
}

.site-footer a:hover {
    color: #d3e8ff;
    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: 12px;
    }

    .content {
        padding: 15px;
        border-radius: 12px;
    }

    .page-shell {
        gap: 10px;
    }

    .drop-zone {
        padding: 16px 10px;
    }

    .button-group {
        display: grid;
        gap: 8px;
    }

    .upload-activity {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
    }

    .brand-inline-logo {
        width: 32px;
        height: 32px;
    }

    .legal-toc {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .legal-section {
        padding: 16px 0;
    }

    .legal-content {
        backdrop-filter: blur(6px);
    }
}