*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f4f5f7;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    text-align: center;
    padding: 28px 20px 12px;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #16213e;
}

main {
    width: 100%;
    max-width: 720px;
    padding: 20px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dropzone {
    width: 100%;
    border: 2px dashed #c0c4cc;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.dropzone.dragover {
    border-color: #4a6cf7;
    background: #eef1ff;
}

.dropzone.has-file {
    border-style: solid;
    border-color: #4a6cf7;
}

.dropzone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
}

.dropzone__icon {
    color: #8b8fa3;
    margin-bottom: 4px;
}

.dropzone p {
    color: #555;
    font-size: 15px;
}

.dropzone__or {
    font-size: 13px !important;
    color: #999 !important;
}

.dropzone__filename {
    font-weight: 500;
    color: #4a6cf7 !important;
    word-break: break-all;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background: #4a6cf7;
    color: #fff;
}

.btn--primary:hover:not(:disabled) {
    background: #3b5de7;
}

.btn--outline {
    background: transparent;
    color: #4a6cf7;
    border: 1.5px solid #4a6cf7;
}

.btn--outline:hover {
    background: #eef1ff;
}

.btn--success {
    background: #22c55e;
    color: #fff;
}

.btn--success:hover {
    background: #16a34a;
}

.actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Progress bar */

.progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress__bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a6cf7, #3b5de7);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress__text {
    font-size: 13px;
    color: #777;
}

.result, .error {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result__text label,
.result__segments label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.result__text textarea {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #d0d4dc;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    background: #fafafa;
}

.result__text textarea:focus {
    outline: none;
    border-color: #4a6cf7;
}

.segments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.segments-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f4f5f7;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e5e7eb;
}

.segments-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.segments-table .seg-time {
    white-space: nowrap;
    color: #888;
    font-size: 13px;
    width: 1%;
    padding-right: 16px;
}

.segments-table .seg-text {
    color: #1a1a2e;
}

.segments-table tr:hover td {
    background: #f8f9ff;
}

.segments-empty {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 12px;
}

.result__time {
    text-align: center;
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.result__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.error p {
    color: #e53e3e;
    font-size: 15px;
    font-weight: 500;
    word-break: break-word;
}
