/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    color: #333;
    background: #f8f9fa;
}

/* ===== Navigation ===== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}
.nav-brand {
    font-size: 1.3em;
    font-weight: 700;
    color: #1a5f2a;
    text-decoration: none;
}
.nav-links a, .nav-links .nav-user {
    margin-left: 18px;
    text-decoration: none;
    color: #555;
    font-size: 0.95em;
}
.nav-links a:hover { color: #1a5f2a; }
.nav-user {
    font-weight: 600;
    color: #333;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 18px;
}
.nav-dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}
.nav-dropdown-trigger:hover { color: #1a5f2a; }
.nav-caret { font-size: 0.65em; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 168px;
    z-index: 200;
    padding: 4px 0;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 9px 16px;
    font-size: 0.9em;
    color: #333;
    text-decoration: none;
    margin: 0;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: #f0f7f1;
    color: #1a5f2a;
}

/* ===== Flash Messages ===== */
.flash-messages { margin-bottom: 20px; }
.flash {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.95em;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ===== Typography ===== */
h1 { margin-bottom: 8px; color: #222; }
h2 { margin: 24px 0 12px; color: #333; font-size: 1.3em; }
.subtitle { color: #666; margin-bottom: 20px; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-primary { background: #1a5f2a; color: white; }
.btn-primary:hover { background: #14491f; }
.btn-lg { padding: 14px 32px; font-size: 1.1em; }

/* ===== Forms ===== */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
    background: white;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.auth-form { margin-top: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.95em;
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 2px rgba(26, 95, 42, 0.15);
}
.form-error {
    display: block;
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 4px;
}
.form-hint {
    display: block;
    color: #888;
    font-size: 0.85em;
    margin-top: 2px;
}
.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.95em;
    color: #666;
}
.auth-link a { color: #1a5f2a; }
.form-actions {
    margin-top: 32px;
    text-align: center;
}

/* ===== Assessment Start ===== */
.assessment-start {
    max-width: 600px;
    margin: 40px auto;
    background: white;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    text-align: center;
}
.assessment-start p { margin-bottom: 16px; color: #555; }
.info-list {
    list-style: none;
    margin: 16px 0 24px;
    padding: 0;
}
.info-list li {
    padding: 6px 0;
    color: #666;
    font-size: 0.95em;
}
.info-list li::before {
    content: "\2713  ";
    color: #1a5f2a;
    font-weight: bold;
}

/* ===== Assessment Questions ===== */
.assessment-form {
    max-width: 700px;
    margin: 0 auto;
}
.question-category {
    margin: 32px 0 16px;
    padding: 8px 16px;
    background: #1a5f2a;
    color: white;
    border-radius: 6px;
    font-size: 1.1em;
}
.question-card {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.question-text {
    font-weight: 600;
    font-size: 1em;
    display: block;
    margin-bottom: 6px;
}
.question-number {
    color: #1a5f2a;
    margin-right: 4px;
}
.question-desc {
    color: #777;
    font-size: 0.9em;
    margin-bottom: 10px;
}
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
}
.radio-option:hover, .checkbox-option:hover {
    background: #f0f7f1;
}
.number-input {
    display: flex;
    align-items: center;
    gap: 8px;
}
.number-input .form-input { width: 120px; }
.number-unit { color: #888; font-size: 0.9em; }

/* ===== Results Page ===== */
.results-page { margin: 0 auto; }

/* Top 3 Cards */
.top-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.priority-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
    border-top: 4px solid #1a5f2a;
}
.priority-1 { border-top-color: #c0392b; }
.priority-2 { border-top-color: #e67e22; }
.priority-3 { border-top-color: #f1c40f; }
.priority-badge {
    display: inline-block;
    background: #1a5f2a;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    margin-bottom: 8px;
}
.priority-1 .priority-badge { background: #c0392b; }
.priority-2 .priority-badge { background: #e67e22; }
.priority-3 .priority-badge { background: #f1c40f; color: #333; }
.priority-card h3 { margin-bottom: 8px; font-size: 1.1em; }
.card-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 12px;
    line-height: 1.5;
}
.card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.card-meta span {
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    color: #555;
}
.card-score {
    font-weight: 700;
    color: #1a5f2a;
    font-size: 0.95em;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}
.results-table th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.9em;
    font-weight: 700;
    color: #444;
    border-bottom: 2px solid #ddd;
    user-select: none;
}
.results-table th.sortable:hover { background: #e8e8e8; }
.results-table th.sort-asc::after { content: " \25B2"; font-size: 0.7em; }
.results-table th.sort-desc::after { content: " \25BC"; font-size: 0.7em; }
.results-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
}
.results-table tbody tr:hover { background: #f9fdf9; }

/* ===== Prep Management Admin ===== */
.pm-page { max-width: 1100px; margin: 0 auto; }
.pm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.pm-actions { display: flex; gap: 10px; }

/* Secondary button */
.btn-secondary {
    background: #6c757d;
    color: white;
}
.btn-secondary:hover { background: #565e64; }
.btn-sm { padding: 6px 14px; font-size: 0.85em; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #bb2d3b; }
.btn-ai {
    background: #5a3e8c;
    color: white;
}
.btn-ai:hover { background: #4a3270; }

/* Prep Management Table */
.pm-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}
.pm-table th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85em;
    font-weight: 700;
    color: #444;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}
.pm-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}
.pm-table tbody tr:hover { background: #f9fdf9; }
.inactive-row { opacity: 0.5; }

/* Form Grid */
.pm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    margin-bottom: 16px;
}

/* AI Section */
.pm-ai-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 16px;
    background: #f3eef8;
    border-radius: 8px;
    border: 1px solid #d4c5e9;
}

/* Status Messages */
.pm-status { font-size: 0.9em; font-weight: 600; }
.pm-loading { color: #5a3e8c; }
.pm-loading::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid #5a3e8c;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pm-success { color: #155724; }
.pm-error { color: #721c24; }

/* Scoring Preview */
.pm-scoring-preview {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.pm-score-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.pm-score-field label { font-weight: 700; white-space: nowrap; }
.pm-small-input { width: 100px !important; }

/* Rules Table */
.pm-rules-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}
.pm-rules-table th {
    padding: 8px 6px;
    text-align: left;
    font-size: 0.85em;
    font-weight: 700;
    color: #555;
    border-bottom: 2px solid #ddd;
}
.pm-rules-table td {
    padding: 6px;
    border-bottom: 1px solid #eee;
}
.pm-rules-table select, .pm-rules-table input {
    font-size: 0.85em;
    padding: 6px 8px;
}

/* Warnings */
.pm-warnings {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.9em;
    color: #856404;
}
.pm-warnings ul {
    margin: 4px 0 0 16px;
    padding: 0;
}

/* Explanation Panel */
.pm-explanation {
    background: #e8f4fd;
    border: 1px solid #b8daef;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
    white-space: pre-wrap;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Re-score Comparison */
.pm-rescore-compare {
    background: #f3eef8;
    border: 1px solid #d4c5e9;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
}
.pm-compare-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 12px 0;
}
.pm-compare-col pre {
    background: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.8em;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

/* Import Styles */
.pm-import-upload {
    max-width: 600px;
    background: white;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.pm-csv-format {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    margin: 16px 0;
}
.pm-csv-format code {
    display: block;
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 0.9em;
}
.pm-upload-form { margin-top: 20px; }
.pm-import-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.pm-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}
.pm-badge-ok { background: #d4edda; color: #155724; }
.pm-badge-err { background: #f8d7da; color: #721c24; }
.pm-badge-warn { background: #fff3cd; color: #856404; }
.pm-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 6px;
}
.pm-tag-ok { background: #d4edda; color: #155724; }
.pm-tag-err { background: #f8d7da; color: #721c24; }
.pm-tag-warn { background: #fff3cd; color: #856404; }
.import-error { background: #fff5f5; }
.import-dup { background: #fffbf0; }

/* ===== Completion Progress ===== */
.completion-counter {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}
.completion-bar-track {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}
.completion-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a5f2a, #28a745);
    border-radius: 6px;
    transition: width 0.4s ease;
    min-width: 0;
}
.completion-text {
    color: #555;
    font-size: 0.95em;
    margin: 0;
}
.completion-text strong {
    color: #1a5f2a;
}

/* ===== Mark-Complete on Priority Cards ===== */
.card-complete-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(26, 95, 42, 0.08);
    border: 2px solid rgba(26, 95, 42, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #1a5f2a;
    transition: background 0.2s, border-color 0.2s;
}
.card-complete-label:hover {
    background: rgba(26, 95, 42, 0.15);
    border-color: rgba(26, 95, 42, 0.4);
}
.card-complete-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #1a5f2a;
    cursor: pointer;
    flex-shrink: 0;
}
.card-complete-text {
    user-select: none;
}

/* ===== Table Status Column ===== */
.table-complete-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.table-complete-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #1a5f2a;
    cursor: pointer;
}
.table-complete-text {
    font-size: 0.85em;
    color: #1a5f2a;
    font-weight: 600;
}

/* ===== Completed Rows ===== */
.completed-row {
    opacity: 0.55;
    background: #f9fdf9 !important;
}
.completed-row td {
    text-decoration: line-through;
    text-decoration-color: #aaa;
}
.completed-row td:last-child {
    text-decoration: none;
}

/* ===== Table Controls ===== */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.table-controls h2 {
    margin: 0;
}

/* ===== Completed Section (Show/Hide) ===== */
.completed-section {
    margin: 24px 0;
}
.btn-toggle-completed {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: background 0.2s;
}
.btn-toggle-completed:hover {
    background: #e9ecef;
}
.completed-list {
    margin-top: 12px;
    background: #f9fdf9;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 12px;
}
.completed-item {
    padding: 8px 4px;
    border-bottom: 1px solid #e8f5e9;
}
.completed-item:last-child {
    border-bottom: none;
}
.completed-item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.completed-item-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #1a5f2a;
    cursor: pointer;
    flex-shrink: 0;
}
.completed-item-name {
    flex: 1;
    color: #333;
    text-decoration: line-through;
    text-decoration-color: #aaa;
}
.completed-item-date {
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
}

/* ===== Newsletter Signup ===== */
.newsletter-section {
    margin: 32px 0;
}
.newsletter-card {
    background: white;
    padding: 24px 28px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #1a5f2a;
}
.newsletter-content h3 {
    margin: 0 0 6px;
    color: #1a5f2a;
    font-size: 1.15em;
}
.newsletter-content p {
    margin: 0 0 16px;
    color: #555;
    font-size: 0.95em;
}
.newsletter-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.newsletter-email-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}
.newsletter-email-input:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 2px rgba(26, 95, 42, 0.15);
}
.newsletter-btn {
    white-space: nowrap;
    padding: 10px 24px;
}
.newsletter-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85em;
    color: #666;
    cursor: pointer;
    line-height: 1.4;
}
.newsletter-consent input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #1a5f2a;
    cursor: pointer;
    flex-shrink: 0;
}
.newsletter-consent a {
    color: #1a5f2a;
}
.newsletter-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
}
.newsletter-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.newsletter-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== Paywall Section ===== */
.paywall-section {
    margin: 32px 0;
    padding: 32px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}
.paywall-header {
    text-align: center;
    margin-bottom: 28px;
}
.paywall-header h2 {
    margin: 0 0 8px;
    color: #1a5f2a;
    font-size: 1.5em;
}
.paywall-header p {
    color: #555;
    font-size: 1.05em;
    margin: 0;
}
.paywall-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 700px) {
    .paywall-options {
        grid-template-columns: 1fr;
    }
}
.paywall-card {
    background: white;
    padding: 28px 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}
.paywall-onetime {
    border-top: 4px solid #1a5f2a;
}
.paywall-subscription {
    border-top: 4px solid #5a3e8c;
}
.paywall-card-badge {
    position: absolute;
    top: -14px;
    right: 16px;
    background: #e67e22;
    color: white;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
}
.paywall-card h3 {
    margin: 0 0 12px;
    font-size: 1.15em;
    color: #222;
}
.paywall-price {
    font-size: 2em;
    font-weight: 800;
    color: #1a5f2a;
    margin-bottom: 16px;
}
.paywall-subscription .paywall-price {
    color: #5a3e8c;
}
.paywall-price-label {
    font-size: 0.4em;
    font-weight: 600;
    color: #888;
    vertical-align: middle;
}
.paywall-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}
.paywall-benefits li {
    padding: 6px 0;
    color: #555;
    font-size: 0.92em;
    line-height: 1.4;
}
.paywall-benefits li::before {
    content: "\2713  ";
    color: #1a5f2a;
    font-weight: bold;
}
.paywall-subscription .paywall-benefits li::before {
    color: #5a3e8c;
}
.paywall-btn {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: auto;
}
.paywall-subscription .paywall-btn {
    background: #5a3e8c;
}
.paywall-subscription .paywall-btn:hover {
    background: #4a3270;
}

/* Table limit badge */
.table-limit-badge {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== Upgrade Page ===== */
.upgrade-placeholder {
    max-width: 500px;
    margin: 60px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}
.upgrade-placeholder h1 {
    margin-bottom: 12px;
    color: #1a5f2a;
}
.upgrade-placeholder p {
    color: #555;
    margin-bottom: 24px;
    font-size: 1.05em;
}

/* ===== Upgrade Section (Free Users, replaces table) ===== */
.upgrade-section {
    margin: 32px 0;
}
.upgrade-section-inner {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9f5ec 100%);
    border: 2px solid #d4edda;
    border-radius: 12px;
    padding: 36px 32px;
    text-align: center;
}
.upgrade-section-inner h2 {
    margin: 0 0 12px;
    color: #1a5f2a;
    font-size: 1.4em;
}
.upgrade-section-text {
    color: #555;
    font-size: 1.05em;
    margin: 0 0 24px;
    line-height: 1.5;
}
.upgrade-section-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.upgrade-btn-sub {
    background: #5a3e8c;
    color: white;
}
.upgrade-btn-sub:hover {
    background: #4a3270;
}

/* ===== All Done Message ===== */
.all-done-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    font-size: 1.1em;
    color: #155724;
    font-weight: 600;
}

/* ===== Account Settings Page ===== */
.settings-page {
    max-width: 560px;
    margin: 0 auto;
}
.settings-section {
    margin-bottom: 32px;
}
.settings-card {
    background: white;
    padding: 28px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.settings-current-value {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 16px;
}
.settings-current-value strong {
    color: #333;
}
.settings-form { margin-top: 0; }
.settings-tier-display {
    display: inline-block;
    background: #e8f4fd;
    color: #0c5460;
    border: 1px solid #bee5eb;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 4px;
}

/* ===== Paywall Card Subtitle ===== */
.paywall-card-subtitle {
    color: #666;
    font-size: 0.95em;
    margin: 0 0 16px;
    line-height: 1.4;
    font-style: italic;
}

/* ===== Implementation Guide Indicators (top 3 cards) ===== */
.guide-indicator {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 10px 0 14px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-left: 3px solid #ced4da;
    border-radius: 0 4px 4px 0;
    overflow: hidden;
}
.guide-label {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.guide-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.guide-badge-premium {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.guide-badge-upsell {
    background: #e8e4f3;
    color: #4a3270;
    border: 1px solid #c9c0e0;
}
/* Locked guide indicator — free and one-time users */
.guide-locked {
    opacity: 0.65;
    border-left-color: #dee2e6;
    cursor: default;
}
.guide-locked .guide-label {
    color: #adb5bd;
}

/* ===== Implementation Guide Accordion (subscription users only) ===== */
.guide-accordion {
    margin: 10px 0 14px;
}
.guide-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #edf2ff;
    border-left: 3px solid #5a3e8c;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}
.guide-accordion-header:hover {
    background: #e0e8ff;
}
.guide-accordion-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #4a3270;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Coming Soon variant — uses existing .guide-label / .guide-badge styles */
.guide-accordion-coming-soon {
    background: #f8f9fa;
    border-left-color: #ced4da;
}
.guide-accordion-coming-soon:hover {
    background: #e9ecef;
}
.guide-chevron {
    font-size: 0.7em;
    color: #5a3e8c;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}
.guide-accordion-coming-soon .guide-chevron {
    color: #6c757d;
}
/* Guide body — shared between content and coming-soon states */
.guide-body {
    padding: 12px 14px;
    background: #fafafa;
    border-left: 3px solid #5a3e8c;
    border-right: 1px solid #e8e4f3;
    border-bottom: 1px solid #e8e4f3;
    border-radius: 0 0 4px 4px;
    font-size: 0.88em;
    line-height: 1.65;
}
.guide-coming-soon-msg {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

/* ===== Implementation Guide Indicators (table rows) ===== */
.guide-indicator-sm {
    margin-top: 4px;
    font-size: 0.75em;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.guide-label-sm {
    font-weight: 500;
}
.guide-tag {
    display: inline-block;
    font-size: 0.85em;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
}
.guide-tag-premium {
    background: #d4edda;
    color: #155724;
}
.guide-tag-upsell {
    background: #e8e4f3;
    color: #4a3270;
}

/* ===== Subscription Upsell Section (one-time users) ===== */
.upgrade-section-sub .upgrade-section-inner {
    background: linear-gradient(135deg, #f3f0fa 0%, #e8e4f3 100%);
    border-color: #c9c0e0;
}
.upgrade-section-sub .upgrade-section-inner h2 {
    color: #4a3270;
}
.upgrade-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    text-align: left;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.upgrade-feature-list li {
    padding: 6px 0;
    font-size: 0.95em;
    color: #4a4a6a;
    line-height: 1.5;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.upgrade-feature-list li:last-child {
    border-bottom: none;
}
