:root {
    --tune-bg: #f3f1eb;
    --tune-surface: #ffffff;
    --tune-surface-alt: #faf9f5;
    --tune-border: rgba(15, 23, 42, 0.11);
    --tune-ink: #1e293b;
    --tune-muted: #64748b;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--tune-bg);
    color: var(--tune-ink);
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}

.tune-shell {
    height: 100vh;
    height: 100dvh;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tune-header {
    flex-shrink: 0;
}

.tune-brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.tune-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--tune-ink);
}

.tune-subtitle {
    font-size: 0.8rem;
    color: var(--tune-muted);
}

.tune-quota-pill {
    background-color: #ffffff;
    color: #334155;
    border: 1px solid var(--tune-border);
    font-weight: 500;
    font-size: 0.76rem;
    padding: 0.42rem 0.72rem;
}

.tune-quota-pill.is-exhausted {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.tune-quota-pill.is-low {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.tune-workspace {
    border-radius: 16px;
    border: 1px solid var(--tune-border) !important;
    background-color: var(--tune-surface);
}

.tune-toolbar {
    background-color: var(--tune-surface-alt);
    flex-shrink: 0;
}

.tune-counter {
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    padding: 0.38rem 0.7rem;
}

.tune-editor-body {
    background-color: var(--tune-surface);
}

.tune-textarea {
    width: 100%;
    height: 100%;
    min-height: 160px;
    flex: 1 1 auto;
    resize: none;
    overflow-y: auto;
    padding: 1.25rem 1.35rem;
    font-size: 1.04rem;
    line-height: 1.82;
    color: var(--tune-ink);
    background-color: var(--tune-surface);
    word-break: keep-all;
    overflow-wrap: break-word;
}

.tune-textarea:focus {
    outline: none;
    box-shadow: none;
    background-color: var(--tune-surface);
}

.tune-textarea::placeholder {
    color: #94a3b8;
    line-height: 1.75;
}

.tune-result-textarea {
    background-color: #fcfcfa;
}

.tune-result-textarea:focus {
    background-color: #fcfcfa;
}

.tune-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.tune-loading-card {
    max-width: 380px;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--tune-border);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.tune-spinner {
    width: 2.6rem;
    height: 2.6rem;
    border-width: 0.25rem;
}

.tune-footer {
    flex-shrink: 0;
}

.tune-big-btn {
    font-size: 1.08rem;
    letter-spacing: -0.01em;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tune-big-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.tune-secondary-btn {
    font-size: 0.98rem;
    border-radius: 12px;
}

.tune-clipboard-helper {
    position: fixed;
    left: -9999px;
    top: 0;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 575.98px) {
    .tune-title {
        font-size: 1.02rem;
    }

    .tune-brand-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .tune-quota-pill {
        font-size: 0.7rem;
        padding: 0.3rem 0.55rem;
    }

    .tune-textarea {
        padding: 0.95rem 1rem;
        font-size: 0.98rem;
        line-height: 1.75;
    }

    .tune-big-btn,
    .tune-secondary-btn {
        font-size: 0.98rem;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}
