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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    color: #1a1a1a;
    background: #fafafa;
    line-height: 1.6;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.description {
    font-size: 0.95rem;
    color: #666;
    max-width: 540px;
    margin: 0 auto;
}

.credit {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.75rem;
}

/* Form */

form {
    margin-bottom: 2rem;
    background: #b2e8e4;
    padding: 1.5rem;
    border-radius: 10px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.875rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: vertical;
    background: #fff;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

input[type="email"] {
    width: 100%;
    padding: 0.75rem 0.875rem;
    margin-top: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input[type="email"]:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

label[for="email-input"] {
    margin-top: 1rem;
}

.email-note {
    margin-top: 0.35rem;
    margin-bottom: 0;
    text-align: left;
}

button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #1a73e8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #1557b0;
}

button[type="submit"]:disabled {
    background: #94b8e8;
    cursor: not-allowed;
}

.form-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
}

/* Loading */

.loading {
    text-align: center;
    padding: 3rem 1rem;
}

.loading p {
    color: #555;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

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

/* Error */

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Clarification */

.clarification {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 6px solid #f9a825;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.clarification h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 0.5rem;
}

.clarification > p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.clarification-questions {
    margin-bottom: 1.25rem;
}

.clarification-questions h3,
.clarification-suggestion h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.clarification-questions ul {
    list-style: none;
    padding: 0;
}

.clarification-questions li {
    padding: 0.35rem 0 0.35rem 1.25rem;
    position: relative;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

.clarification-questions li::before {
    content: "?";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #f9a825;
}

.edit-hint {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.suggested-rewrite {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #333;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.suggested-rewrite:focus {
    outline: none;
    border-color: #f9a825;
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.12);
}

.use-suggestion-btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #f9a825;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.use-suggestion-btn:hover {
    background: #f57f17;
}

/* Verdict */

.verdict {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.verdict h2 {
    font-size: 1.3rem;
    margin-bottom: 0.35rem;
}

.verdict p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.verdict.green {
    background: #e8f5e9;
    border-left: 6px solid #2e7d32;
}

.verdict.green h2 { color: #2e7d32; }

.verdict.caution {
    background: #fff8e1;
    border-left: 6px solid #f57f17;
}

.verdict.caution h2 { color: #e65100; }

.verdict.reconsider {
    background: #ffebee;
    border-left: 6px solid #c62828;
}

.verdict.reconsider h2 { color: #c62828; }

/* Analysis cards */

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
}

.card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card p {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.55;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge.positive,
.badge.strong {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge.neutral,
.badge.moderate {
    background: #f5f5f5;
    color: #616161;
}

.badge.negative,
.badge.weak {
    background: #ffebee;
    color: #c62828;
}

.badge.contradicted {
    background: #ffcdd2;
    color: #b71c1c;
}

/* List sections */

.list-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.list-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

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

.list-section li {
    padding: 0.4rem 0 0.4rem 1.25rem;
    position: relative;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

.list-section li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

#consequences-section li::before {
    background: #ef5350;
}

#alternatives-section li::before {
    background: #1a73e8;
}

/* Bottom line */

.bottom-line-section {
    margin-bottom: 2rem;
}

.bottom-line-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.bottom-line-box {
    background: #f0f4ff;
    border: 1px solid #c5cfe8;
    border-radius: 10px;
    padding: 1.25rem;
}

.bottom-line-box p {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
}

/* Citation badges */

.citation-cluster {
    display: inline;
    white-space: nowrap;
}

.citation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e8edf4;
    color: #4a6fa5;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: super;
    margin: 0 1px;
    position: relative;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    text-decoration: none;
}

.citation-badge:hover {
    background: #4a6fa5;
    color: #fff;
    text-decoration: none;
}

/* Sources section */

.sources-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.sources-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.sources-section ol {
    padding-left: 1.5rem;
    margin: 0;
}

.sources-section li {
    padding: 0.3rem 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

.source-title {
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

a.source-title {
    color: #1a73e8;
}

a.source-title:hover {
    text-decoration: underline;
}

.source-author {
    color: #777;
    margin-left: 0.25rem;
}

.source-author::before {
    content: "\2014\00a0";
}

/* Raw fallback */

#raw-fallback pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Footer */

footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

footer p {
    font-size: 0.8rem;
    color: #999;
    max-width: 480px;
    margin: 0 auto;
}

.beta-notice {
    margin-top: 0.75rem;
    font-weight: 600;
    color: #777;
}

.beta-notice a {
    color: #1a73e8;
    text-decoration: none;
}

.beta-notice a:hover {
    text-decoration: underline;
}

/* Utility */

.hidden {
    display: none !important;
}

/* Shared result banner */

.shared-banner {
    background: #e8f0fe;
    border: 1px solid #c5d7f2;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.shared-banner p {
    font-size: 0.9rem;
    color: #444;
    margin: 0;
}

.shared-banner a {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: none;
}

.shared-banner a:hover {
    text-decoration: underline;
}

/* Print & Share buttons */

.print-bar {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.print-btn,
.share-btn {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.print-btn:hover {
    border-color: #1a73e8;
    background: #f0f4ff;
}

.share-btn:hover {
    border-color: #2e7d32;
    background: #e8f5e9;
}

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

/* Print-only elements (hidden on screen) */

.print-only {
    display: none;
}

/* Print styles */

@media print {
    body {
        background: #fff;
        padding: 0;
        font-size: 11pt;
    }

    header, form, .form-note, #loading, #error,
    .print-bar, .shared-banner, footer, #raw-fallback {
        display: none !important;
    }

    .print-only {
        display: block !important;
        margin-bottom: 1.5rem;
    }

    .print-only h1 {
        font-size: 18pt;
        margin-bottom: 0.5rem;
    }

    .print-policy-label {
        font-weight: 600;
        font-size: 10pt;
        color: #555;
        margin-bottom: 0.25rem;
    }

    .print-policy-text {
        font-size: 11pt;
        color: #222;
        padding: 0.5rem 0.75rem;
        background: #f5f5f5;
        border-radius: 4px;
        border-left: 3px solid #1a73e8;
    }

    #results {
        display: block !important;
    }

    .verdict {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card {
        break-inside: avoid;
    }

    .list-section {
        break-inside: avoid;
    }

    .bottom-line-box {
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sources-section {
        break-inside: avoid;
    }

    .citation-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .analysis-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Responsive */

@media (max-width: 640px) {
    body {
        padding: 1.25rem 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }
}
