.owlypia-essay-previous-attempts .owlypia-essay-results-display {
    margin-bottom: 24px;
}

.owlypia-official-summary {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #1b5e20;
    font-size: 15px;
}

.owlypia-attempt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.owlypia-official-badge {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
}

.owlypia-official-attempt {
    border: 2px solid #2e7d32;
    box-shadow: 0 2px 12px rgba(46, 125, 50, 0.15);
}

.owlypia-live-official-note {
    text-align: center;
    margin: 0 auto 16px;
    font-weight: 600;
}

.owlypia-live-official-note.is-official {
    color: #2e7d32;
}

.owlypia-live-official-note.not-official {
    color: #9a6b00;
}

.owlypia-attempt-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a90e2;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.owlypia-attempts-info {
    background: #eef7ff;
    border-left: 4px solid #4a90e2;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

.owlypia-attempts-exhausted {
    background: #fff4e5;
    border-left-color: #f0ad4e;
}

/* Essay Evaluator Styles */
.owlypia-essay-evaluator-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.owlypia-essay-evaluator-container h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #333;
    text-align: left;
}

.owlypia-ai-warning {
    margin: 0 0 14px;
    padding: 12px 15px;
    background: #fff8e8;
    border-left: 4px solid #e0a100;
    border-radius: 5px;
    color: #5c4a12;
    font-size: 16px;
    line-height: 1.5;
}

.owlypia-instructions-tips-row {
    display: flex;
    gap: 16px;
    margin: 14px 0;
    flex-wrap: wrap;
}

.owlypia-instruction-card,
.owlypia-tips-card {
    flex: 1;
    min-width: 240px;
    padding: 16px;
    background: #f5f9fd;
    border: 1px solid #e0e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.owlypia-instruction-card > strong,
.owlypia-tips-card > strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1em;
    color: #1d4d7c;
}

.owlypia-instruction-card li strong,
.owlypia-tips-card li strong {
    font-weight: 700;
    color: inherit;
}

.owlypia-instruction-card ol,
.owlypia-tips-card ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.6;
}

.owlypia-instruction-card ol li,
.owlypia-tips-card ul li {
    margin-bottom: 6px;
}

.owlypia-essay-topic-display {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #4a90e2;
}

.owlypia-essay-topic-display strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.owlypia-essay-topic-display p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.owlypia-essay-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.owlypia-essay-textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.owlypia-paste-notice {
    display: none;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 5px;
    background: #fff4e5;
    border-left: 4px solid #f0ad4e;
    color: #8a5a00;
    font-size: 14px;
    font-weight: 600;
}

.owlypia-word-count {
    text-align: right;
    font-size: 14px;
    color: #666;
    margin: 0;
    width: auto;
    justify-self: end;
    align-self: end;
    padding: 0 4px 6px 0;
}

.owlypia-word-count-warning {
    color: #d9534f;
    font-weight: bold;
}

.owlypia-essay-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    width: 100%;
}

.owlypia-task-mascot {
    width: 143px;
    height: auto;
    max-height: 143px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    justify-self: center;
    align-self: center;
}

.owlypia-essay-actions .owlypia-submit-button {
    grid-column: 2;
    justify-self: center;
    width: 300px;
    max-width: 100%;
}

.owlypia-submit-button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    max-width: 300px;
}

.owlypia-submit-button:hover {
    background: #357ae8;
}

.owlypia-submit-button:disabled {
    background: #b3b3b3;
    cursor: not-allowed;
}

.owlypia-loading {
    text-align: center;
    margin: 20px 0;
    display: none;
    width: 100%;
}

.owlypia-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: owlypia-spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes owlypia-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.owlypia-results {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.owlypia-results h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

/* Enhanced score display for better readability */
.owlypia-score-display {
    text-align: center;
    margin: 0 auto 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 5px solid #4a90e2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: auto;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.owlypia-score-display strong {
    margin-right: 10px;
    font-size: 18px;
    color: #333;
}

.owlypia-score-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    font-family: 'Arial', sans-serif;
}

/* Score colors based on performance */
.owlypia-score-low {
    border-left-color: #d9534f;
    background: rgba(217, 83, 79, 0.05);
}

.owlypia-score-medium {
    border-left-color: #f0ad4e;
    background: rgba(240, 173, 78, 0.05);
}

.owlypia-score-high {
    border-left-color: #5cb85c;
    background: rgba(92, 184, 92, 0.05);
}

/* Enhanced categories layout */
.owlypia-categories-results {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.owlypia-categories-results h4 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.owlypia-category-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 20px 0;
    background: #fbfbfb;
    padding: 15px;
    border-radius: 8px;
}

.owlypia-category-score {
    flex: 1;
    min-width: 200px;
    margin: 10px;
    padding: 15px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.owlypia-category-score:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.owlypia-category-name {
    font-weight: bold;
    color: #4a90e2;
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.owlypia-category-value {
    font-weight: bold;
    font-size: 20px;
    color: #333;
    display: block;
}

/* Improved AI feedback section */
.owlypia-detailed-feedback {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    line-height: 1.7;
    color: #333;
    border-left: 4px solid #4a90e2;
}

.owlypia-detailed-feedback strong {
    color: #333;
}

/* Improved results history display */
.owlypia-essay-results-display {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.owlypia-essay-results-display h3 {
    font-size: 22px;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.owlypia-essay-results-display h4 {
    font-size: 18px;
    color: #333;
    margin: 25px 0 15px;
    border-left: 4px solid #4a90e2;
    padding-left: 10px;
}

.owlypia-submitted-essay {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 10px 0 25px;
    line-height: 1.7;
    font-size: 15px;
    color: #333;
}

.owlypia-results-details {
    margin-top: 20px;
}

.owlypia-feedback {
    margin-top: 25px;
}

.owlypia-improved-essay {
    margin-top: 25px;
    background: #f0f8ff;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.7;
    border-left: 4px solid #4a90e2;
}

/* Submission date styling */
.owlypia-submission-date {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 25px;
}

/* Error message styling */
.owlypia-essay-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    color: #856404;
}

.owlypia-essay-error p {
    margin: 0;
}

/* API Key field styling */
.api-key-field {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.masked-key {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-right: 10px;
    font-family: monospace;
    font-size: 14px;
    color: #666;
}

#reset-api-key {
    margin-right: 5px;
}

.api-key-input {
    margin-top: 10px;
}

/* Shortcode info styling */
.owlypia-shortcode-info {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.owlypia-shortcode-info h2 {
    margin-top: 0;
}

.owlypia-shortcode-info code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.owlypia-shortcode-info ul {
    margin-left: 20px;
}

/* CSS chart styles */
.owlypia-css-chart {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.owlypia-css-chart-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.owlypia-css-chart-bars {
    display: flex;
    justify-content: space-around;
    height: 250px;
    margin: 0 auto;
    max-width: 800px;
}

.owlypia-css-chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: 0 5px;
}

.owlypia-css-chart-label {
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.owlypia-css-chart-bar-container {
    width: 40px;
    height: 180px;
    background: #f1f1f1;
    border-radius: 4px;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.owlypia-css-chart-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 4px 4px;
    transition: height 1s ease-out;
}

.owlypia-css-chart-value {
    margin-top: 8px;
    font-weight: bold;
}

/* AI Suggested Improvement section styles */
#owlypia-improved-essay-content {
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
    line-height: 1.6;
    border-left: 4px solid #4a90e2;
}

#owlypia-improved-essay-content h1,
#owlypia-improved-essay-content h2,
#owlypia-improved-essay-content h3,
#owlypia-improved-essay-content h4 {
    color: #2c3e50;
    margin-top: 16px;
    margin-bottom: 10px;
}

#owlypia-improved-essay-content ul,
#owlypia-improved-essay-content ol {
    padding-left: 25px;
    margin: 10px 0;
}

#owlypia-improved-essay-content li {
    margin-bottom: 5px;
}

#owlypia-improved-essay-content p {
    margin-bottom: 10px;
}

#owlypia-improved-essay-content strong {
    color: #1a5490;
}

/* AI Detection styling */
.owlypia-ai-detection {
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
}

.owlypia-ai-detection strong {
    display: block;
    margin-bottom: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .owlypia-essay-evaluator-container {
        padding: 15px;
    }

    .owlypia-essay-textarea {
        min-height: 200px;
    }

    .owlypia-essay-actions {
        grid-template-columns: 1fr auto 1fr;
        margin-top: 4px;
    }

    .owlypia-task-mascot {
        width: 94px;
        max-height: 94px;
    }

    .owlypia-essay-actions .owlypia-submit-button {
        grid-column: 2;
        width: min(300px, 100%);
    }

    .owlypia-category-scores {
        flex-direction: column;
    }

    .owlypia-category-score {
        margin: 5px 0;
    }

    .api-key-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .masked-key {
        margin-bottom: 10px;
        width: 100%;
    }

    #reset-api-key {
        margin-bottom: 5px;
    }

    .owlypia-css-chart-bars {
        flex-direction: column;
        height: auto;
        align-items: center;
    }

    .owlypia-css-chart-bar {
        flex-direction: row;
        width: 100%;
        max-width: 300px;
        margin: 5px 0;
        height: 60px;
    }

    .owlypia-css-chart-label {
        width: 100px;
        text-align: right;
        margin-right: 10px;
        margin-bottom: 0;
    }

    .owlypia-css-chart-bar-container {
        width: 150px;
        height: 30px;
    }

    .owlypia-css-chart-bar-fill {
        height: 100% !important;
        width: 0;
        transition: width 1s ease-out;
    }

    .owlypia-css-chart-value {
        margin-top: 0;
        margin-left: 10px;
    }
}

.owlypia-essay-results,
#owlypia-essay-results.owlypia-results {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.owlypia-efb,
.owlypia-efb * { box-sizing: border-box; }

.owlypia-efb {
    background: #fff;
    border: 1px solid #e4eef8;
    border-radius: 18px;
    padding: 22px;
    margin: 16px 0;
    box-shadow: 0 8px 28px rgba(28, 64, 110, 0.06);
    color: #24324a;
}

.owlypia-efb-head,
.owlypia-efb-topic,
.owlypia-efb-score,
.owlypia-efb-wrote-head {
    display: flex;
    gap: 16px;
}

.owlypia-efb-head { justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.owlypia-efb-title { margin: 0; font-size: 28px; color: #1e3a5f; }
.owlypia-efb-subtitle { margin: 4px 0 0; color: #607089; }
.owlypia-efb-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.owlypia-efb-attempt { background: #eef3fb; color: #3d4d66; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.owlypia-efb-official { color: #1b8a4a; font-size: 13px; font-weight: 700; }
.owlypia-efb-unofficial { color: #9a6b00; font-size: 13px; font-weight: 600; max-width: 220px; text-align: right; }

.owlypia-efb-topic,
.owlypia-efb-wrote,
.owlypia-efb-score,
.owlypia-efb-note,
.owlypia-efb-example {
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.owlypia-efb-topic { align-items: center; justify-content: space-between; background: #e8f4f8; border: 1px solid #d3e8f0; border-left: 4px solid #4a90e2; }
.owlypia-efb-wrote { background: #f4f0ff; border: 1px solid #e4daf8; }
.owlypia-efb-score { align-items: center; background: #f3fbf6; border: 1px solid #d9f3e3; }
.owlypia-efb-note-well { background: #f3fbf6; border: 1px solid #d9f3e3; }
.owlypia-efb-note-next { background: #fff8ee; border: 1px solid #f3e2c2; }
.owlypia-efb-example { background: #f7f3ff; border: 1px solid #e4daf8; }

.owlypia-efb-kicker { font-size: 14px; font-weight: 700; color: #5d6b82; }
.owlypia-efb-topic p,
.owlypia-efb-wrote p,
.owlypia-efb-score-copy p,
.owlypia-efb-note p,
.owlypia-efb-example p { margin: 6px 0 0; line-height: 1.55; color: #3d4d66; }
.owlypia-efb-owl { width: 92px; height: auto; flex-shrink: 0; }

.owlypia-efb-wrote-title { font-size: 18px; font-weight: 800; color: #5b3cc4; }
.owlypia-efb-wrote-sub { color: #7b6b9a; font-size: 14px; }
.owlypia-efb-wrote-mark { width: 36px; height: 36px; border-radius: 10px; background: #e7defc; color: #6d4cc4; display: flex; align-items: center; justify-content: center; }
.owlypia-efb-wrote-mark svg { width: 20px; height: 20px; }
.owlypia-efb-copy { margin-left: auto; border: 0; background: #e7defc; color: #5b3cc4; border-radius: 8px; padding: 6px 10px; font-weight: 700; cursor: pointer; }

.owlypia-efb-score-left { min-width: 180px; padding-right: 18px; border-right: 1px solid #d5eadc; }
.owlypia-efb-score-num { display: flex; align-items: flex-end; gap: 8px; }
.owlypia-efb-score-main { font-size: 64px; line-height: 0.9; font-weight: 800; }
.owlypia-efb-score-max { font-size: 28px; font-weight: 700; color: #7d8b9c; padding-bottom: 6px; }
.owlypia-efb-score-copy { display: flex; gap: 12px; flex: 1; }
.owlypia-efb-trophy { width: 42px; height: 42px; border-radius: 12px; background: #e5f8ec; color: #14924a; display: flex; align-items: center; justify-content: center; }
.owlypia-efb-trophy svg { width: 24px; height: 24px; }
.owlypia-efb-band-title { font-size: 26px; font-weight: 800; }

.owlypia-efb-excellent .owlypia-efb-score-main,
.owlypia-efb-excellent .owlypia-efb-band-title,
.owlypia-efb-great .owlypia-efb-score-main,
.owlypia-efb-great .owlypia-efb-band-title { color: #14924a; }
.owlypia-efb-well .owlypia-efb-score-main,
.owlypia-efb-well .owlypia-efb-band-title { color: #d97706; }
.owlypia-efb-keep .owlypia-efb-score-main,
.owlypia-efb-keep .owlypia-efb-band-title { color: #e11d48; }
.owlypia-efb-build .owlypia-efb-score-main,
.owlypia-efb-build .owlypia-efb-band-title { color: #e11d48; }
.owlypia-efb-check .owlypia-efb-score-main,
.owlypia-efb-check .owlypia-efb-band-title { color: #be123c; }

.owlypia-efb-section-title { margin: 0 0 12px; color: #1e3a5f; }
.owlypia-efb-criteria { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.owlypia-efb-crit { border-radius: 14px; padding: 14px; }
.owlypia-efb-crit-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.owlypia-efb-crit-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.owlypia-efb-crit-icon svg { width: 28px; height: 28px; }
.owlypia-efb-crit-copy { min-width: 0; }
.owlypia-efb-crit-label { font-weight: 700; line-height: 1.2; }
.owlypia-efb-crit-score { font-size: 22px; font-weight: 800; margin-top: 2px; line-height: 1.1; color: #1e3a5f; }
.owlypia-efb-crit-score span { font-size: 18px; font-weight: 700; color: #5d6b82; }
.owlypia-efb-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.8); overflow: hidden; }
.owlypia-efb-bar span { display: block; height: 100%; border-radius: inherit; }
.owlypia-efb-crit-content { background: #e8f8ef; color: #157a3a; }
.owlypia-efb-crit-content .owlypia-efb-crit-icon { background: #d4f3e1; }
.owlypia-efb-crit-content .owlypia-efb-bar span { background: #22a35a; }
.owlypia-efb-crit-organization { background: #fff4e8; color: #d46a12; }
.owlypia-efb-crit-organization .owlypia-efb-crit-icon { background: #ffe6cc; }
.owlypia-efb-crit-organization .owlypia-efb-bar span { background: #f08a24; }
.owlypia-efb-crit-language { background: #f4efff; color: #6d4cc4; }
.owlypia-efb-crit-language .owlypia-efb-crit-icon { background: #e6dcff; }
.owlypia-efb-crit-language .owlypia-efb-bar span { background: #7b61c9; }
.owlypia-efb-crit-skills { background: #eaf3ff; color: #1d5fa8; }
.owlypia-efb-crit-skills .owlypia-efb-crit-icon { background: #d7e7ff; }
.owlypia-efb-crit-skills .owlypia-efb-bar span { background: #2f7dd1; }

.owlypia-efb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.owlypia-efb-note-title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.owlypia-efb-note-title svg { width: 22px; height: 22px; }
.owlypia-efb-note-well .owlypia-efb-note-title { color: #157a3a; }
.owlypia-efb-note-next .owlypia-efb-note-title { color: #b86b12; }
.owlypia-efb-example .owlypia-efb-note-title { color: #6d4cc4; }

@media (max-width: 900px) {
    .owlypia-efb-criteria { grid-template-columns: 1fr 1fr; }
    .owlypia-efb-score, .owlypia-efb-split { display: grid; grid-template-columns: 1fr; }
    .owlypia-efb-score-left { border-right: 0; padding-right: 0; }
}
@media (max-width: 640px) {
    .owlypia-efb-head, .owlypia-efb-criteria { display: block; }
    .owlypia-efb-criteria > * { margin-bottom: 12px; }
    .owlypia-efb-score-main { font-size: 52px; }
}
