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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #eef2ff 0%, #f1f5f9 60%, #f0f4f8 100%);
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 260px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(30, 64, 175, 0.05), transparent);
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 20px 60px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 24px;
    color: #fff;
}

.logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin-bottom: 10px;
    object-fit: cover;
    filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

header h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
    font-weight: 500;
}

.how-it-works {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.how-it-works h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.how-it-works > p {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.how-step {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.4;
    border-left: 3px solid transparent;
}

.how-step:nth-child(1) {
    background: #eff6ff;
    border-left-color: #3b82f6;
}

.how-step:nth-child(2) {
    background: #f5f3ff;
    border-left-color: #8b5cf6;
}

.how-step:nth-child(3) {
    background: #ecfdf5;
    border-left-color: #10b981;
}

.how-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.how-step:nth-child(2) .how-step-num {
    background: #8b5cf6;
}

.how-step:nth-child(3) .how-step-num {
    background: #10b981;
}

.how-step strong {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.88rem;
}

.report-details {
    margin-top: 4px;
}

.report-details summary {
    font-size: 0.88rem;
    font-weight: 600;
    color: #3b82f6;
    cursor: pointer;
    padding: 6px 0;
    list-style: none;
}

.report-details summary::before {
    content: "▸ ";
}

.report-details[open] summary::before {
    content: "▾ ";
}

.report-details ul {
    margin: 8px 0 0;
    padding: 0 0 0 8px;
    list-style: none;
}

.report-details li {
    font-size: 0.84rem;
    color: #475569;
    padding: 5px 0;
    line-height: 1.5;
    border-bottom: 1px solid #f1f5f9;
}

.report-details li:last-child {
    border-bottom: none;
}

.report-details li strong {
    color: #1e293b;
}

@media (max-width: 600px) {
    .how-steps {
        grid-template-columns: 1fr;
    }
}

.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.input-card {
    padding: 0;
    overflow: hidden;
}

.tabs {
    display: flex;
    background: #f8f9fb;
    border-bottom: 1px solid #e5e7eb;
}

.tab {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    font-family: inherit;
}

.tab-icon {
    font-size: 1.1rem;
}

.tab.active {
    color: #2563eb;
    background: #fff;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #2563eb;
    border-radius: 2px 2px 0 0;
}

.tab:hover:not(.active) {
    color: #374151;
    background: #f3f4f6;
}

.tab-content {
    padding: 24px;
}

.hidden {
    display: none !important;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.93rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.7;
    color: #1a1a2e;
    background: #fafbfc;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.word-count {
    text-align: right;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 8px;
    font-weight: 500;
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-icon-wrapper {
    margin-bottom: 16px;
}

.upload-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #eff6ff;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #3b82f6;
    font-weight: 300;
}

.upload-title {
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.85rem;
    margin-top: 6px;
    color: #9ca3af;
}

#file-info {
    margin-top: 14px;
    padding: 14px 18px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #dbeafe;
}

.file-info-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

#file-name {
    font-weight: 600;
    color: #1e40af;
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
}

.btn-link:hover {
    color: #dc2626;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 48px);
    margin: 0 24px 24px;
    padding: 15px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37,99,235,0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    margin-bottom: 28px;
    background: #fff;
    color: #2563eb;
    border: 1.5px solid #dbeafe;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.error {
    margin: 0 24px 24px;
    padding: 14px 18px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
    font-weight: 500;
}

#loading-section {
    text-align: center;
    padding: 60px 20px;
}

.loading-card {
    max-width: 360px;
    margin: 0 auto;
    padding: 48px 32px;
    text-align: center;
}

.spinner-ring {
    display: inline-block;
    margin-bottom: 20px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-title {
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.loading-sub {
    color: #9ca3af;
    font-size: 0.88rem;
}

.disclaimer {
    background: linear-gradient(135deg, #fffbeb, #fef9c3);
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 28px;
    color: #92400e;
    font-size: 0.88rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.disclaimer-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.score-cards {
    margin-bottom: 20px;
}

.scores-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 26px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.scores-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-row {
    margin-bottom: 18px;
}

.score-row:last-child {
    margin-bottom: 0;
}

.score-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 7px;
}

.score-row-label {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 500;
}

.score-row-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    padding: 3px 10px;
    border-radius: 99px;
    letter-spacing: 0.3px;
}

.score-row-value.bar-high { background: #22c55e; color: #fff; }
.score-row-value.bar-mid  { background: #f59e0b; color: #fff; }
.score-row-value.bar-low  { background: #ef4444; color: #fff; }

.score-bar-track {
    height: 10px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

.bar-high { background: #22c55e; }
.bar-mid  { background: #f59e0b; }
.bar-low  { background: #ef4444; }

.indicator-card {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 18px 24px;
    text-align: center;
    margin-bottom: 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: -0.2px;
}

.strengths-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 32px;
}

.strengths-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.strengths-card h3 {
    font-size: 1.05rem;
    color: #6b7280;
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-arrow {
    font-size: 1.1rem;
}

.strengths-card ul {
    list-style: none;
    padding: 0;
}

.strengths-card li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.strengths-card li:last-child {
    border-bottom: none;
}

.strengths-card li::before {
    flex-shrink: 0;
    margin-top: 2px;
}

.strengths-card.strengths {
    border-top: 4px solid #22c55e;
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 60%);
}

.strengths-card.strengths h3 {
    color: #16a34a;
}

.strengths-card.strengths li::before {
    content: "\2713";
    color: #fff;
    background: #22c55e;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.strengths-card.growth {
    border-top: 4px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 60%);
}

.strengths-card.growth h3 {
    color: #d97706;
}

.strengths-card.growth li::before {
    content: "\2192";
    color: #fff;
    background: #f59e0b;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.report-sections {
    margin-bottom: 32px;
}

.report-section {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border-left: 4px solid #e5e7eb;
}

.report-section:nth-child(1) { border-left-color: #8b5cf6; }
.report-section:nth-child(2) { border-left-color: #f59e0b; }
.report-section:nth-child(3) { border-left-color: #3b82f6; }
.report-section:nth-child(4) { border-left-color: #ef4444; }
.report-section:nth-child(5) { border-left-color: #10b981; }

.section-header {
    padding: 18px 22px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.section-header:hover {
    background: #f8f9fb;
}

.section-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.section-arrow {
    color: #9ca3af;
    transition: transform 0.25s;
    font-size: 0.85rem;
}

.section-arrow.open {
    transform: rotate(180deg);
}

.section-body {
    padding: 0 22px 22px;
    display: none;
}

.section-body.open {
    display: block;
}

.section-overview {
    color: #475569;
    font-size: 0.92rem;
    margin-bottom: 18px;
    line-height: 1.7;
}

.section-patterns {
    margin-bottom: 18px;
}

.section-patterns h4,
.section-examples h4,
.section-flagged h4 {
    font-size: 0.78rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    font-weight: 700;
}

.pattern-item {
    padding: 6px 0;
    font-size: 0.9rem;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pattern-item::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
}

.example-card {
    background: #f8f9fb;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 10px;
    border-left: 3px solid #3b82f6;
}

.example-quote {
    font-style: italic;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.6;
}

.example-note {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

.example-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.flagged-item {
    background: #fffbeb;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 10px;
    border-left: 3px solid #f59e0b;
}

.flagged-phrase {
    font-weight: 600;
    color: #92400e;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.flagged-reason {
    font-size: 0.85rem;
    color: #78716c;
    margin-bottom: 6px;
    line-height: 1.5;
}

.flagged-reflection {
    font-size: 0.85rem;
    color: #1e40af;
    font-style: italic;
}

.panel {
    padding: 28px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.highlighted-text-panel { border-left-color: #3b82f6; }
.recommendations-section { border-left-color: #10b981; }
.reflection-section { border-left-color: #8b5cf6; }

.panel h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 1.15rem;
}

.highlight-legend {
    display: flex;
    gap: 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
}

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

.legend-swatch.authentic {
    background: #dcfce7;
    border: 1.5px solid #86efac;
}

.legend-swatch.neutral {
    background: #dbeafe;
    border: 1.5px solid #93c5fd;
}

.legend-swatch.generic {
    background: #fef3c7;
    border: 1.5px solid #fcd34d;
}

.highlighted-text {
    font-size: 0.92rem;
    line-height: 1.85;
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    padding: 18px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.hl-authentic {
    background: rgba(34,197,94,0.15);
    border-bottom: 2px solid #86efac;
    border-radius: 3px;
    padding: 1px 3px;
    cursor: help;
    transition: background 0.2s;
}

.hl-authentic:hover {
    background: rgba(34,197,94,0.25);
}

.hl-neutral {
    background: rgba(59,130,246,0.12);
    border-bottom: 2px solid #93c5fd;
    border-radius: 3px;
    padding: 1px 3px;
    cursor: help;
    transition: background 0.2s;
}

.hl-neutral:hover {
    background: rgba(59,130,246,0.22);
}

.hl-generic {
    background: rgba(245,158,11,0.15);
    border-bottom: 2px solid #fcd34d;
    border-radius: 3px;
    padding: 1px 3px;
    cursor: help;
    transition: background 0.2s;
}

.hl-generic:hover {
    background: rgba(245,158,11,0.25);
}

.legend-swatch.ai-styled {
    background: #fce7f3;
    border: 1.5px solid #f472b6;
}

.hl-ai-styled {
    background: rgba(236,72,153,0.15);
    border-bottom: 2px solid #f472b6;
    border-radius: 3px;
    padding: 1px 3px;
    cursor: help;
    transition: background 0.2s;
}

.hl-ai-styled:hover {
    background: rgba(236,72,153,0.25);
}

.recommendations-section h2 {
    color: #1e293b;
}

.recommendation-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34,197,94,0.1);
}

.recommendation-card:last-child {
    margin-bottom: 0;
}

.recommendation-area {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #16a34a;
    margin-bottom: 6px;
}

.recommendation-suggestion {
    font-size: 0.92rem;
    color: #1e293b;
    line-height: 1.65;
    margin-bottom: 10px;
    font-weight: 500;
}

.recommendation-example {
    font-size: 0.87rem;
    color: #475569;
    font-style: italic;
    background: #fff;
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid #dcfce7;
    line-height: 1.55;
}

.reflection-section ul {
    list-style: none;
    padding: 0;
}

.reflection-section li {
    padding: 12px 0;
    font-size: 0.92rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.reflection-section li:last-child {
    border-bottom: none;
}

.reflection-section li::before {
    content: "?";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.75rem;
    margin-top: 1px;
}

@media (max-width: 700px) {
    .container { padding: 24px 14px 40px; }
    header h1 { font-size: 1.6rem; }
    .hero-bg { height: 280px; }
    .score-cards { grid-template-columns: 1fr 1fr; }
    .strengths-grid { grid-template-columns: 1fr; }
    .highlight-legend { flex-direction: column; gap: 8px; }
    .btn-primary { width: calc(100% - 32px); margin: 0 16px 16px; }
    .tab-content { padding: 16px; }
    .panel { padding: 20px; }
}

@media (max-width: 420px) {
    .score-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .score-card { padding: 16px 12px; }
    .score-card .score-value { font-size: 1.8rem; }
}
