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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #323130;
    background: #fff;
    line-height: 1.5;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: #0078D4;
    color: #fff;
    padding: 14px 20px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 16px;
    font-weight: 600;
}

.status {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

/* Sections */
.section {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

/* Auth */
.auth-prompt {
    text-align: center;
    margin-top: 40px;
}

.auth-prompt p {
    margin-bottom: 20px;
    color: #605e5c;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #edebe9;
    border-top-color: #0078D4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* Draft content */
.draft-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.draft-text {
    width: 100%;
    flex: 1;
    min-height: 200px;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 4px;
    padding: 14px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.7;
    color: #323130;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
}

.draft-text:focus {
    border-color: #0078D4;
    background: #fff;
}

/* Draft metadata */
.draft-meta {
    font-size: 11px;
    color: #a19f9d;
    margin-bottom: 8px;
}

/* Make draft section flex so textarea fills space */
#draft-section {
    display: flex;
    flex-direction: column;
}

/* No draft */
.no-draft {
    text-align: center;
    margin-top: 40px;
    color: #605e5c;
}

.no-draft .hint {
    font-size: 12px;
    color: #a19f9d;
    margin-top: 8px;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    flex: 1;
    font-family: inherit;
}

.btn-primary {
    background: #0078D4;
    color: #fff;
}

.btn-primary:hover {
    background: #106ebe;
}

.btn-primary:active {
    background: #005a9e;
}

.btn-secondary {
    background: #edebe9;
    color: #323130;
}

.btn-secondary:hover {
    background: #e1dfdd;
}

.btn-secondary:active {
    background: #d2d0ce;
}

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

/* Error */
.error-box {
    background: #fde7e9;
    border: 1px solid #f1707b;
    border-radius: 4px;
    padding: 14px;
}

.error-box p {
    color: #a80000;
    margin-bottom: 12px;
    font-size: 13px;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #323130;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 100;
}

.toast.visible {
    opacity: 1;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        color: #e1dfdd;
        background: #1e1e1e;
    }

    .header {
        background: #0063b1;
    }

    .auth-prompt p {
        color: #a19f9d;
    }

    .spinner {
        border-color: #3b3a39;
        border-top-color: #4da6ff;
    }

    .draft-text {
        background: #2d2d2d;
        border-color: #3b3a39;
        color: #e1dfdd;
    }

    .draft-text:focus {
        border-color: #4da6ff;
        background: #323232;
    }

    .no-draft {
        color: #a19f9d;
    }

    .no-draft .hint {
        color: #797775;
    }

    .btn-primary {
        background: #4da6ff;
        color: #1e1e1e;
    }

    .btn-primary:hover {
        background: #3d96ef;
    }

    .btn-primary:active {
        background: #2d86df;
    }

    .btn-secondary {
        background: #3b3a39;
        color: #e1dfdd;
    }

    .btn-secondary:hover {
        background: #484746;
    }

    .btn-secondary:active {
        background: #555453;
    }

    .error-box {
        background: #442726;
        border-color: #d13438;
    }

    .error-box p {
        color: #f1707b;
    }

    .toast {
        background: #e1dfdd;
        color: #1e1e1e;
    }
}
