* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f7f7f8;
    color: #222;
}

header {
    padding: 22px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e2e2;
}

header h1 {
    margin: 0 0 4px 0;
    font-size: 21px;
}

header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    max-width: 560px;
}

main {
    max-width: 920px;
    margin: 0 auto;
    padding: 16px;
}

.hidden {
    display: none !important;
}

.warning {
    background: #fdf2f2;
    border: 1px solid #f2c1c1;
    color: #a33;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 15px;
    margin: 0;
}

video {
    width: 100%;
    max-height: 380px;
    background: #000;
    display: block;
    border-radius: 4px;
    margin-bottom: 12px;
}

#uploadLabel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 42px 20px;
    cursor: pointer;
    text-align: center;
}

#uploadLabel:hover {
    border-color: #999;
    background: #fafafa;
}

.small {
    font-size: 12px;
    color: #888;
}

.bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

#downloadBar {
    height: 100%;
    width: 0%;
    background: #3366cc;
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.space-between {
    justify-content: space-between;
    margin-bottom: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3366cc;
}

button {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    background: #3366cc;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: #2b56ad;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: transparent;
    color: #3366cc;
    border: 1px solid #ccd6ea;
}

.secondary:hover:not(:disabled) {
    background: #f2f5fb;
}

#status {
    font-size: 13px;
    color: #777;
    min-height: 16px;
    margin: 10px 0 0 0;
}

.result {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.result:hover {
    background: #f5f7fb;
    border-color: #d6ddec;
}

.result img {
    width: 78px;
    height: 54px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.result .info {
    flex: 1;
    min-width: 0;
}

.result .top {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 5px;
}

.result .meter {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.result .meter div {
    height: 100%;
    background: #3366cc;
}

@media (min-width: 800px) {
    .layout {
        display: flex;
        align-items: flex-start;
        gap: 16px;
    }

    .layout .left {
        flex: 1.15;
        min-width: 0;
    }

    .layout .right {
        flex: 1;
        min-width: 0;
    }
}