* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f5f6f8;
    color: #202124;
}

.app {
    width: min(1200px, calc(100% - 40px));
    margin: 40px auto;
}

.header {
    margin-bottom: 30px;
}

.header h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.header p {
    margin: 0;
    color: #666;
}

.input-panel,
.result-panel,
.srt-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.input-panel label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    min-height: 280px;
    resize: vertical;

    padding: 14px;

    border: 1px solid #d5d8dc;
    border-radius: 8px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 14px;
    line-height: 1.5;

    outline: none;
}

textarea:focus {
    border-color: #777;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

button {
    border: 0;
    border-radius: 7px;
    padding: 10px 16px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button.primary {
    background: #202124;
    color: white;
}

button:not(.primary) {
    background: #e9eaed;
    color: #202124;
}

#status {
    margin-top: 14px;
    min-height: 20px;
    color: #666;
    font-size: 14px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 16px;
}

.result-header h2 {
    margin: 0;
    font-size: 20px;
}

#counter {
    color: #777;
    font-size: 14px;
}

.subtitle {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 16px;

    padding: 14px 0;

    border-bottom: 1px solid #eee;
}

.subtitle:last-child {
    border-bottom: 0;
}

.subtitle-time {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        monospace;

    font-size: 13px;
    color: #777;
}

.subtitle-text {
    font-size: 16px;
    line-height: 1.45;
}

.subtitle-number {
    display: inline-block;
    margin-right: 8px;

    color: #999;
    font-size: 12px;
}

#srt_output {
    margin: 0;

    min-height: 100px;
    max-height: 500px;

    overflow: auto;

    padding: 16px;

    border-radius: 8px;

    background: #f5f6f8;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 13px;
    line-height: 1.6;

    white-space: pre-wrap;
}

@media (max-width: 700px) {

    .app {
        width: calc(100% - 20px);
        margin: 20px auto;
    }

    .subtitle {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .actions {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}