:root {
    --primary-color: #333;
    --accent-color: #007aff;
    --bg-color: #f5f5f7;
    --card-bg: #fff;
    --text-color: #1d1d1f;
    --border-color: #d2d2d7;
    --radius: 12px;
    --spacing: 20px;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.subtitle {
    color: #86868b;
    margin: 0;
    font-size: 16px;
}

section {
    margin-top: 10px;
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

/* Inputs & Textarea */
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="password"]:focus,
textarea:focus {
    border-color: var(--accent-color);
}

textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.hint {
    font-size: 12px;
    color: #86868b;
    margin-top: 6px;
}

/* Channel Selection */
.channel-options {
    display: flex;
    gap: 10px;
}

.channel-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.channel-btn:hover {
    background: #f5f5f7;
}

.channel-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Actions */
.actions {
    margin-top: 10px;
}

#improveBtn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#improveBtn:hover:not(:disabled) {
    background: #0062cc;
}

#improveBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Output */
.output-box {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: 16px;
    margin-bottom: 10px;
}

.secondary-btn {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    float: right;
}

.secondary-btn:hover {
    background: var(--accent-color);
    color: white;
}

.hidden {
    display: none;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    body {
        padding: 0;
        background: white;
    }

    .container {
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
    }
}