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

:root {
    --font-title: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #ffffff;
    color: #1a1a1a;
}

h1, h2, h3 {
    font-family: var(--font-title);
    letter-spacing: -0.01em;
}

h1 {
    font-weight: 900;
}

h2, h3 {
    font-weight: 800;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 10;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
}

.brand {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #0a1f3d;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2.2rem;
}

.nav > ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav > ul > li {
    position: relative;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding-left: 1.4rem;
    border-left: 1px solid #e0e0e0;
}

.auth-nav a {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
    text-decoration: none;
}

.auth-nav a:hover {
    color: #0066cc;
}

.auth-nav .dropdown {
    position: relative;
}

.dropdown-label.account-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}

.avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #0066cc;
    background-size: cover;
    background-position: center;
    color: #fff;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-menu {
    left: auto;
    right: 0;
}

.nav a,
.dropdown-label {
    display: inline-block;
    font-family: var(--font-title);
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    padding: 0.5rem 0.1rem;
    cursor: pointer;
}

.nav a:hover,
.dropdown-label:hover {
    color: #0066cc;
}

.dropdown-menu {
    display: none;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    padding: 0.4rem 0;
    flex-direction: column;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.dropdown-menu a:hover {
    background: #f5f7fa;
    color: #0066cc;
}

.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 60px);
}

/* Homepage */

.home-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 0;
}

.home-intro {
    text-align: center;
    padding-top: 1rem;
}

.home-intro h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.home-intro p {
    max-width: 700px;
    margin: 0 auto;
    color: #444;
    line-height: 1.6;
    font-size: 1.02rem;
}

.home-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
}

.home-section-desc {
    color: #666;
    margin-bottom: 1.4rem;
}

.fade-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #d5d5d5, transparent);
    margin: 0 auto;
    max-width: 1000px;
}

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 1.6rem 1.2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    min-height: 120px;
}

.bubble:hover {
    transform: translateY(-3px);
    border-color: #0066cc;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.bubble-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0066cc;
}

.bubble-sub {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.3;
}

/* Training material */

.training-page {
    max-width: 900px;
}

.training-page h1 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.training-intro {
    color: #333;
    line-height: 1.5;
    margin-bottom: 1.8rem;
}

.training-intro a {
    color: #0066cc;
}

.training-category {
    margin-bottom: 2rem;
}

.training-category h2 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.training-category-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}

.training-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.8rem;
}

.training-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.training-card:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.training-card-title {
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.training-card-note {
    font-size: 0.85rem;
    color: #666;
}

/* Quiz */

.quiz-root {
    display: flex;
    justify-content: center;
}

.quiz-card {
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

.quiz-intro h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.quiz-intro p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
    color: #333;
}

.quiz-note {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.quiz-intro h3 {
    margin: 1.4rem 0 0.6rem;
    font-size: 1rem;
}

.quiz-pool-list {
    list-style: disc;
    padding-left: 1.4rem;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.6;
}

.quiz-length-options {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.quiz-length-btn {
    border: 1px solid #dfe3e8;
    background: #fafbfc;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.quiz-length-btn:hover {
    border-color: #0066cc;
}

.quiz-length-btn.selected {
    border-color: #0066cc;
    background: #eef4ff;
    color: #0066cc;
}

.quiz-results-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.quiz-btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.quiz-btn-primary {
    background: #0066cc;
    color: #fff;
}

.quiz-btn-primary:hover {
    background: #0052a3;
}

.quiz-btn-secondary {
    background: #f0f2f5;
    color: #1a1a1a;
}

.quiz-btn-secondary:hover {
    background: #e2e6ea;
}

.quiz-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quiz-progress {
    margin-bottom: 1.2rem;
}

.quiz-progress-bar {
    background: #eef0f3;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.quiz-progress-fill {
    background: #0066cc;
    height: 100%;
    transition: width 0.2s ease;
}

.quiz-progress-fill.weak {
    background: #cc3333;
}

.quiz-progress-label {
    font-size: 0.8rem;
    color: #666;
}

.quiz-domain-tag {
    display: inline-block;
    background: #eef4ff;
    color: #0066cc;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.8rem;
}

.quiz-question {
    font-size: 1.15rem;
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    background: #fafbfc;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option:hover {
    border-color: #0066cc;
}

.quiz-option.selected {
    border-color: #0066cc;
    background: #eef4ff;
}

.quiz-option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #e2e6ea;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.quiz-option.selected .quiz-option-letter {
    background: #0066cc;
    color: #fff;
}

.quiz-save-status {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.quiz-save-status a {
    color: #0066cc;
    font-weight: 600;
}

/* Flash messages */

.flash-messages {
    max-width: 1000px;
    margin: 0 auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.flash-success {
    background: #eafaf0;
    border-color: #b8e6c8;
    color: #1a6a35;
}

.flash-error {
    background: #fdecec;
    border-color: #f3b8b8;
    color: #a3241f;
}

/* Auth pages (login / signup / forgot password) */

.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

.auth-card h1 {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
}

.auth-hint {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.auth-question {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    padding: 0.8rem 1rem;
    background: #f5f7fa;
    border-radius: 8px;
}

.auth-field {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.auth-field input {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
}

.auth-field input:focus {
    outline: none;
    border-color: #0066cc;
}

.auth-submit {
    width: 100%;
    margin-top: 0.3rem;
}

.auth-alt-link {
    margin-top: 1.2rem;
    font-size: 0.88rem;
    text-align: center;
    color: #666;
}

.auth-alt-link a {
    color: #0066cc;
    font-weight: 600;
    text-decoration: none;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
}

.quiz-results h3 {
    margin: 1.6rem 0 0.8rem;
    font-size: 1.05rem;
}

.quiz-score-summary {
    text-align: center;
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.quiz-score-summary.pass {
    background: #eafaf0;
}

.quiz-score-summary.fail {
    background: #fdecec;
}

.quiz-score-number {
    font-size: 2rem;
    font-weight: 700;
}

.quiz-score-pct {
    font-size: 1.1rem;
    color: #444;
}

.quiz-verdict {
    margin-top: 0.4rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.quiz-score-summary.pass .quiz-verdict {
    color: #1a8a3e;
}

.quiz-score-summary.fail .quiz-verdict {
    color: #c62828;
}

.quiz-domain-row {
    margin-bottom: 0.8rem;
}

.quiz-domain-row-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.quiz-improvement-item {
    margin-bottom: 1rem;
}

.quiz-resource-list {
    list-style: disc;
    padding-left: 1.4rem;
    margin-top: 0.3rem;
}

.quiz-resource-list a {
    color: #0066cc;
}

.quiz-review-item {
    border-left: 3px solid #ccc;
    padding: 0.6rem 0 0.6rem 0.9rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.quiz-review-item.correct {
    border-left-color: #1a8a3e;
}

.quiz-review-item.incorrect {
    border-left-color: #c62828;
}

.quiz-review-q {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.quiz-review-answer {
    color: #333;
}

.quiz-review-correct {
    color: #1a8a3e;
}

/* Admin layout */

.admin-layout {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 220px);
    margin: 0 -1.5rem;
}

.admin-sidebar {
    width: 190px;
    flex-shrink: 0;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
    overflow: hidden;
    transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

.admin-sidebar.collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    white-space: nowrap;
}

.admin-sidebar-link {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.95rem;
    color: #444;
    text-decoration: none;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
}

.admin-sidebar-link:hover {
    background: #f5f7fa;
    color: #0066cc;
}

.admin-sidebar-link.active {
    background: #eef4ff;
    color: #0066cc;
}

.admin-divider {
    position: relative;
    width: 1px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, transparent, #d5d5d5 15%, #d5d5d5 85%, transparent);
}

.admin-collapse-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #d5d5d5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.admin-collapse-btn:hover {
    border-color: #0066cc;
}

.admin-collapse-arrow {
    font-size: 0.85rem;
    color: #666;
    line-height: 1;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
}

.admin-page-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.admin-page-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.admin-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1.2rem;
}

.admin-tab {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    padding: 0 0 0.7rem 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.admin-tab:hover {
    color: #0066cc;
}

.admin-tab.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.individual-cert-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    white-space: normal;
}

.individual-cert-chip {
    font-size: 0.78rem;
    background: #f5f7fa;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    color: #444;
    white-space: nowrap;
}

.admin-attempt-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.2rem;
}

.admin-attempt-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #eee;
}

.admin-attempt-title {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.05rem;
}

.admin-attempt-date {
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.2rem;
}

.admin-attempt-score {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.admin-attempt-score.pass {
    color: #1a8a3e;
}

.admin-attempt-score.fail {
    color: #c62828;
}

.admin-table-wrap {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #eef0f3;
    white-space: nowrap;
}

.admin-table th {
    font-family: var(--font-title);
    font-weight: 700;
    color: #444;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.account-name-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-weight: 700;
    color: #0066cc;
    cursor: pointer;
    font-size: 0.9rem;
}

.account-name-btn:hover {
    text-decoration: underline;
}

.status-chip {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.status-chip.active {
    background: #eafaf0;
    color: #1a8a3e;
}

.status-chip.locked {
    background: #fdecec;
    color: #c62828;
}

/* Modal (account edit popout) */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 30, 0.45);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.8rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-box h2 {
    font-size: 1.2rem;
    margin-bottom: 1.1rem;
}

.field-note {
    font-weight: 400;
    color: #888;
    font-size: 0.78rem;
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1.2rem;
}

/* Profile page */

.profile-page {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding-top: 1rem;
}

.profile-picture-label {
    display: inline-block;
    cursor: pointer;
}

.profile-picture-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto;
    background-color: #0066cc;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 transparent;
    transition: box-shadow 0.15s ease;
}

.profile-picture-circle:hover {
    box-shadow: 0 0 0 3px #0066cc;
}

.profile-picture-initial {
    color: #fff;
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 2.6rem;
}

.profile-name {
    margin-top: 1rem;
    font-size: 1.3rem;
}

.profile-time-spent {
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
}

.profile-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 0;
}

.profile-pie-wrap {
    flex-shrink: 0;
}

.profile-pie {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
}

.profile-pie-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.2rem;
    color: #333;
    box-shadow: inset 0 0 0 1px #f0f0f0;
}

.profile-legend {
    list-style: none;
    text-align: left;
    font-size: 0.85rem;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.profile-history {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-history-row {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.9rem;
}

.profile-history-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.92rem;
}

.profile-history-date {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

.profile-history-weak {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}

.profile-history-weak a {
    color: #0066cc;
}

.profile-history-weak-none {
    color: #1a8a3e;
}

/* Training Plans */

.tp-page {
    max-width: 800px;
    margin: 0 auto;
}

.tp-page h1 {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}

.tp-page-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.4rem;
}

.tp-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
}

.tp-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 1rem 1.3rem;
    cursor: pointer;
    text-align: left;
}

.tp-header:hover {
    background: #f5f7fa;
}

.tp-header-title {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.05rem;
    color: #1a1a1a;
}

.tp-header-chevron {
    color: #999;
    font-size: 1.1rem;
    transition: transform 0.15s ease;
}

.tp-card:has(.tp-body:not([hidden])) .tp-header-chevron {
    transform: rotate(90deg);
}

.tp-body {
    padding: 0 1.3rem 1.2rem;
    border-top: 1px solid #eee;
}

.tp-summary {
    color: #333;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 1rem 0;
}

/* Training Plan modal */

.tp-modal-box {
    max-width: 520px;
}

.tp-modal-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.tp-modal-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.tp-progress-caption {
    font-size: 0.8rem;
}

.tp-progress-wheel {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
    transition: background 0.2s ease;
}

.tp-progress-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px #f0f0f0;
}

.tp-progress-value {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 0.85rem;
    color: #333;
}

.tp-modal-body {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.tp-area {
    margin-bottom: 1.1rem;
}

.tp-area h3 {
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.tp-guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-guide-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    cursor: pointer;
}

.tp-guide-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.tp-guide-item a {
    color: #0066cc;
}

/* Profile badges */

.profile-badges {
    text-align: left;
}

.profile-badges-title {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.badges-grid-wrap {
    position: relative;
    overflow: hidden;
    max-height: 225px;
    transition: max-height 0.3s ease;
}

.badges-grid-wrap.expanded {
    max-height: 3000px;
}

.badges-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.badges-grid-wrap.expanded .badges-fade {
    opacity: 0;
}

.badges-toggle-btn {
    display: block;
    margin: 1rem auto 0;
    background: none;
    border: 1px solid #dfe3e8;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0066cc;
    cursor: pointer;
}

.badges-toggle-btn:hover {
    border-color: #0066cc;
    background: #eef4ff;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 1.3rem 0.6rem;
    text-align: center;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-circle {
    position: relative;
    overflow: hidden;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    border: 3px solid #d5d5d5;
    cursor: default;
    transition: transform 0.15s ease;
}

.badge-circle:hover {
    transform: translateY(-2px);
}

.badge-emoji {
    font-size: 1.7rem;
    line-height: 1;
}

.badge-circle.locked {
    opacity: 0.35;
    filter: grayscale(1);
}

.badge-circle.earned.tier-bronze {
    border-color: #cd7f32;
    background: #fdf1e7;
}

.badge-circle.earned.tier-silver {
    border-color: #c0c0c0;
    background: #f5f5f7;
}

.badge-circle.earned.tier-gold {
    border-color: #ffd700;
    background: #fffbe6;
}

.badge-circle.earned.tier-trophy {
    border-color: #4fc3f7;
    background: #eaf9ff;
}

.badge-circle.earned.tier-none {
    border-color: #0066cc;
    background: #eef4ff;
}

/* Diagonal shimmer sweep on hover - two white bands of differing thickness */
.badge-circle::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -70%;
    width: 45%;
    height: 220%;
    background: linear-gradient(
        75deg,
        transparent 0%,
        transparent 42%,
        rgba(255, 255, 255, 0.85) 46%,
        rgba(255, 255, 255, 0.85) 49%,
        transparent 53%,
        transparent 60%,
        rgba(255, 255, 255, 0.5) 64%,
        rgba(255, 255, 255, 0.5) 68%,
        transparent 72%,
        transparent 100%
    );
    transform: translateX(-250%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

.badge-circle:hover::after {
    transform: translateX(430%);
}

.badge-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #444;
    line-height: 1.2;
}

.badge-circle.locked ~ .badge-name {
    color: #999;
}
