.page-section {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 10px;
    color: #1f1f1f;
}

.page-header p {
    font-size: 18px;
    color: #555;
    margin: 0;
}

.content-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.content-card h2 {
    font-size: 24px;
    margin: 0 0 18px 0;
    color: #222;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.info-item {
    background: #f8faff;
    border: 1px solid #e8eefc;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-value {
    display: block;
    font-size: 16px;
    font-weight: 400;
    color: #1f2937;
    line-height: 1.5;
}

/* ── Profile Page ────────────────────────────────── */

.profile-flash {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 500;
}
.profile-flash--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.profile-flash--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.profile-avatar-img,
.profile-avatar-initials {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar-initials {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
}
.profile-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.profile-avatar-edit:hover {
    background: #f3f4f6;
    color: #374151;
}

.profile-hero-name {
    font-size: 26px;
    font-weight: 700;
    color: #1f1f1f;
    margin: 0 0 4px 0;
}
.profile-hero-email {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 12px 0;
}
.profile-hero-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: capitalize;
}
.profile-badge--role {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.profile-badge--premium {
    background: #fefce8;
    color: #92400e;
    border: 1px solid #fde68a;
}
.profile-badge--free {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.profile-input {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    background: #f8faff;
    outline: none;
    transition: border-color 0.2s;
}
.profile-input:focus {
    border-color: #6366f1;
    background: #fff;
}
.profile-form-actions {
    display: flex;
    justify-content: flex-end;
}
.profile-save-btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.profile-save-btn:hover {
    background: #4f46e5;
}

/* ── Usage Bar ───────────────────────────────────── */

.usage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.usage-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}
.usage-count {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}
.usage-bar-track {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.usage-bar-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 99px;
    transition: width 0.4s ease;
}
.usage-bar-fill--warn {
    background: #f59e0b;
}
.usage-bar-fill--full {
    background: #ef4444;
}
.usage-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
.usage-hint--warn {
    color: #b45309;
}
.usage-hint--danger {
    color: #b91c1c;
}
.usage-locked {
    text-align: center;
    padding: 16px 0;
    color: #6b7280;
    font-size: 15px;
}
/* ── Usage Breakdown ─────────────────────────────── */
.usage-breakdown {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}
.usage-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f8faff;
    border: 1px solid #e8eefc;
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 100px;
}
/* ── Cost Estimate ───────────────────────────────── */
.cost-estimate-card {
    margin-top: 20px;
    padding: 16px;
    background: #f8faff;
    border: 1px solid #e8eefc;
    border-radius: 12px;
}
.cost-estimate-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 14px 0;
}
.cost-estimate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}
.cost-estimate-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cost-value {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}
.cost-note {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}
/* ── Help / Support ─────────────────────────────── */
.support-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-text {
    margin: 0;
    color: #555;
    font-size: 16px;
    line-height: 1.6;
}

.support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.support-link {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
}

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

.support-link-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.support-link-btn:hover {
    background: #e0e7ff;
    color: #3730a3;
}

.support-link-btn--secondary {
    background: #f3f4f6;
    color: #374151;
}

.support-link-btn--secondary:hover {
    background: #e5e7eb;
    color: #111827;
}
/* ── Help / Support ─────────────────────────────── */
.support-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-text {
    margin: 0;
    color: #555;
    font-size: 16px;
    line-height: 1.6;
}

.support-meta {
    margin-top: 18px;
}
.worked-examples-page {
    max-width: 1100px;
    margin: 0 auto;
}

.worked-examples-title {
    color: #1d4ed8;
    margin-bottom: 10px;
}

.worked-examples-subtitle {
    color: #475569;
    font-size: 16px;
    margin-bottom: 28px;
}

.worked-examples-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.subject-card {
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.subject-toggle {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #84a1df, #446bd6);
    color: #ffffff;
    padding: 20px 24px;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    transition: background 0.25s ease;
}

.subject-toggle:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.subject-toggle-text {
    display: inline-block;
}

.topic-card {
    margin: 18px 20px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #f8fbff;
    overflow: hidden;
}

.topic-toggle {
    width: 100%;
    border: none;
    background: #eef5ff;
    color: #0f172a;
    padding: 16px 18px;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.topic-toggle:hover {
    background: #e0eeff;
}

.topic-grade {
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
}

.toggle-arrow {
    display: inline-block;
    font-size: 24px;
    transition: transform 0.25s ease;
}

.small-arrow {
    font-size: 20px;
}

.toggle-arrow.rotate {
    transform: rotate(90deg);
}

.toggle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.toggle-content.open {
    max-height: 1000px;
}

.worked-example-links {
    list-style: none;
    margin: 0;
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.worked-example-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #d8e4f2;
    border-radius: 12px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.22s ease;
}

.worked-example-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.example-link-arrow {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
}

.worked-examples-empty {
    color: #94a3b8;
    font-size: 16px;
}
.empty-subject-box {
    margin: 18px 20px;
    padding: 16px 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 15px;
}