:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --primary-color: #2563eb;
    --text-color: #0f172a;
    --border-color: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    line-height: 1.6;
}

.container {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

h2 {
    margin-top: 0;
    font-size: 24px;
    font-weight: 700;
}

.subtext {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 160px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: 16px;
    transition: background 0.2s ease;
}

button:hover {
    background-color: #1d4ed8;
}

.legend-box {
    display: flex;
    gap: 16px;
    background: #f1f5f9;
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #334155;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-top: 28px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.result-card.failed {
    border-color: #fca5a5;
    background-color: #fef2f2;
}

/* Responsive Result Card Header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.card-header > div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.card-header .badge {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive Signature Banner */
.signature-banner {
    margin: 14px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allows text to drop below tag cleanly on narrow viewports */
    gap: 6px 8px;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.signature-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: #e2e8f0;
    color: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    flex-shrink: 0; /* Prevents badge from being squished */
}

/* Small Screen Optimization (< 480px) */
@media (max-width: 480px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-header .badge {
        align-self: flex-start;
        font-size: 12px;
    }

    .signature-banner {
        font-size: 12px;
        padding: 7px 10px;
    }
}

.model-title {
    font-size: 18px;
    font-weight: 700;
}

/* Responsive Score Box */
.score-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.score-number {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.score-details {
    flex: 1;
    min-width: 0; /* Crucial: allows flex child to shrink without overflowing */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    line-height: 1.3;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease-in-out;
}

/* Small Screen Optimization (< 480px) */
@media (max-width: 480px) {
    .score-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .score-details {
        width: 100%;
    }

    .score-label {
        font-size: 12px;
    }

    .progress-bar-container {
        height: 7px;
    }
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-success { background-color: #dcfce7; color: #166534; }

.text-reader {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.8;
    word-break: break-word;
}

.token-span {
    padding: 2px 4px;
    margin: 0 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.15s ease;
    display: inline;
}

.token-span:hover {
    filter: brightness(0.92);
}

footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

footer p:first-of-type a {
    white-space: nowrap;
}

/* Responsive Header Navigation & Back Button */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.header-nav .brand-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-nav .brand-logo {
    display: block;
}

.header-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;   /* Prevents text from breaking into multiple lines */
    flex-shrink: 0;        /* Prevents the button from being squished */
    transition: all 0.15s ease-in-out;
}

.header-nav .nav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Mobile Screen Adjustment (< 480px) */
@media (max-width: 480px) {
    .header-nav {
        gap: 8px;
        margin-bottom: 18px;
    }

    .header-nav .nav-link {
        padding: 5px 10px;
        font-size: 12px;
    }
}
@media (max-width: 520px) {
    .header-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-nav .nav-link {
        align-self: flex-start; /* Keeps the button neatly aligned to the left */
        font-size: 13px;
        padding: 6px 12px;
    }
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.brand-logo {
    max-height: 78px;
    width: auto;
    max-width: 100%;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.nav-link:hover { text-decoration: underline; }

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 0;
    font-size: 15px;
    user-select: none;
}

details summary:hover {
    color: #1d4ed8;
}

details[open] summary {
    margin-bottom: 12px;
}

summary.hidden-summary {
    display: none !important;
}

details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

.lang-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}
.lang-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.drop-zone {
    border: 2px dashed var(--primary-color, #2563eb);
    border-radius: 12px;
    padding: 36px 20px;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
    background-color: #eff6ff;
    border-color: #1d4ed8;
}
.preview-img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    margin-top: 16px;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
/* Programmatic UI for extra information */
.prog-container {
    max-width: 860px;
    margin: 48px auto 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
    color: #1e293b;
}
.prog-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}
.faq-item summary {
    padding: 14px 18px;
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
    color: #0f172a;
    background: #ffffff;
    user-select: none;
}
.faq-item summary:hover {
    background: #f8fafc;
}
.faq-item p {
    margin: 0;
    padding: 0 18px 16px 18px;
    font-size: 13.5px;
    color: #475569;
    line-height: 1.6;
}

1. CSS Styles
Add this to your stylesheet (or inside <style> in <head>):

CSS
/* Modern Header & Navigation Bar */
.site-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-switcher {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 2px;
    min-width: 0; /* Allows container to shrink on mobile */
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: #64748b;
    white-space: nowrap;
    min-width: 0; /* Required for flexbox child ellipsis truncation */
    transition: all 0.15s ease-in-out;
}

.nav-tab.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.nav-tab svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0; /* Prevents icon from collapsing when text is long */
}

.nav-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Mobile & Small Screen Optimization */
@media (max-width: 600px) {
    .nav-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 12px;
        gap: 8px;
    }

    .nav-brand {
        justify-content: center;
    }

    .nav-switcher {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Forces equal 50/50 split */
    }

    .nav-tab {
        justify-content: center;
        padding: 6px 8px;
        font-size: 12px;
        gap: 4px;
    }
}

@media (max-width: 360px) {
    .nav-tab {
        padding: 5px 4px;
        font-size: 11px;
    }

    .nav-tab svg {
        width: 13px;
        height: 13px;
    }
}