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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    min-height: 100vh;
    padding: 40px 16px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.subtitle {
    margin-top: 8px;
    color: #718096;
    font-size: 1rem;
}

/* Nav */
.nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.nav-link {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: #718096;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover { background: #e2e8f0; color: #2d3748; }
.nav-link.active { background: #667eea; color: white; }

/* Guide page */
.guide-text {
    color: #4a5568;
    line-height: 1.75;
}

.guide-text--mb { margin-bottom: 20px; }
.guide-text--mt { margin-top: 20px; }

.guide-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.guide-label--green { color: #48bb78; }
.guide-label--red   { color: #e53e3e; }

.guide-list {
    list-style: none;
    color: #4a5568;
}

.guide-list li {
    padding: 6px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    border-bottom: 1px solid #f0f4f8;
}

.guide-list li:last-child { border-bottom: none; }

.guide-list--ordered {
    list-style: decimal;
    padding-left: 20px;
}

.guide-list--ordered li { padding-left: 8px; }

.guide-list--spaced li { padding: 10px 0; }

.example-block {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.example-block--bad  { background: #fff5f5; border-left: 3px solid #e53e3e; }
.example-block--good { background: #f0fff4; border-left: 3px solid #48bb78; }

.example-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    color: #718096;
}

.example-text {
    color: #2d3748;
    font-size: 0.9rem;
    line-height: 1.6;
    font-style: italic;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Upload area */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f0ff;
}

.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-text { font-size: 1rem; font-weight: 500; color: #4a5568; }
.upload-sub  { margin: 8px 0; color: #a0aec0; font-size: 0.875rem; }
.upload-hint { margin-top: 12px; color: #a0aec0; font-size: 0.8rem; }

/* File selected */
.file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
}

.file-icon { font-size: 1.2rem; }

.file-selected span:nth-child(2) {
    flex: 1;
    font-size: 0.9rem;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-clear {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.btn-clear:hover { color: #e53e3e; }

/* Buttons */
.btn-primary {
    display: inline-block;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary:hover { background: #5a67d8; }

.btn-analyze {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-analyze:hover:not(:disabled) { background: #5a67d8; }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; }

/* Loading */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text { text-align: center; font-weight: 600; color: #2d3748; }
.loading-sub  { text-align: center; color: #a0aec0; font-size: 0.875rem; margin-top: 6px; }

/* Error */
.error-card { text-align: center; }
.error-icon { font-size: 2rem; margin-bottom: 12px; }
.error-text { color: #e53e3e; font-weight: 500; margin-bottom: 20px; }

/* Score */
.score-card { text-align: center; }
.score-label { font-size: 0.875rem; font-weight: 600; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }

.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg   { fill: none; stroke: #e2e8f0; stroke-width: 10; }
.score-fill {
    fill: none;
    stroke: #667eea;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 339.3;
    transition: stroke-dashoffset 1.2s ease;
}

.score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
}

.score-grade { font-size: 1.1rem; font-weight: 600; color: #667eea; }

/* Summary */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 14px;
}

.summary-text { color: #4a5568; line-height: 1.7; }

/* Strengths / Improvements */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 580px) { .two-col { grid-template-columns: 1fr; } }

.feedback-list { list-style: none; }

.feedback-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f4f8;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

.feedback-list li:last-child { border-bottom: none; }

.strengths-card    .feedback-list li::before { content: "✓ "; color: #48bb78; font-weight: 700; }
.improvements-card .feedback-list li::before { content: "→ "; color: #ed8936; font-weight: 700; }

.center { text-align: center; }

/* Footer */
.footer {
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.footer-copy {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-bottom: 12px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    font-size: 0.85rem;
    color: #718096;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: #667eea; }

/* Inline links */
.inline-link {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid #667eea;
}

.inline-link:hover { color: #5a67d8; }

/* Utility */
.hidden { display: none !important; }