/* NS Academy — stylesheet
   Clean, medical-professional look. Deep navy + teal + warm accents. */

:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --primary: #0e4b8a;
    --primary-dark: #083161;
    --accent: #14a098;
    --accent-dark: #0b7a74;
    --warn: #e8a33d;
    --danger: #d14343;
    --success: #2f9e56;
    --text: #1a202c;
    --text-muted: #5a6577;
    --text-light: #8b93a3;
    --border: #e3e7ee;
    --shadow: 0 2px 10px rgba(14,75,138,0.07);
    --shadow-lg: 0 8px 28px rgba(14,75,138,0.12);
    --radius: 10px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px; line-height: 1.55; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── TOP BAR ─── */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center;
    padding: 12px 20px; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700;
    font-size: 19px; color: var(--primary-dark); }
.brand-icon { font-size: 24px; }
.brand-tag { font-size: 11px; color: var(--accent-dark); text-transform: uppercase;
    letter-spacing: 0.8px; font-weight: 600; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topnav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text);
    font-size: 14px; font-weight: 500; }
.topnav a:hover { background: var(--bg); text-decoration: none; }
.topnav a.admin-link { color: var(--warn); }
.btn-logout { color: var(--text-muted) !important; font-size: 13px !important; }
.btn-primary { background: var(--primary); color: #fff !important; padding: 9px 18px !important;
    border-radius: var(--radius-sm); font-weight: 600 !important; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none !important; }
.credit-chip { background: var(--accent); color: #fff; padding: 5px 11px;
    border-radius: 20px; font-size: 12px; font-weight: 700;
    transition: all 0.15s; }
.credit-chip:hover { background: var(--accent-dark, #ad6940); color: #fff !important;
    transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-decoration: none !important; }

/* ─── MAIN ─── */
main { max-width: 1200px; margin: 0 auto; padding: 28px 20px; min-height: calc(100vh - 180px); }

/* ─── CARDS & LAYOUT ─── */
.card { background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-lg { padding: 28px; }

h1, h2, h3 { margin-top: 0; color: var(--primary-dark); font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

/* ─── BUTTONS ─── */
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; border: 0; cursor: pointer;
    font-size: 14px; font-weight: 600; text-decoration: none; transition: all 0.15s; }
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--primary-dark); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── FORMS ─── */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text);
    font-size: 13px; }
.form-row input, .form-row textarea, .form-row select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; font-family: inherit; background: #fff; }
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px;
    font-size: 14px; border-left: 3px solid; }
.alert-success { background: #e9f7ee; border-color: var(--success); color: #1a6734; }
.alert-danger { background: #fbeaea; border-color: var(--danger); color: #8d2626; }
.alert-warn { background: #fef3e1; border-color: var(--warn); color: #7e5308; }
.alert-info { background: #e5f0f9; border-color: var(--primary); color: var(--primary-dark); }

/* ─── HOME HERO ─── */
.hero { text-align: center; padding: 48px 20px 32px; background:
    linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border-radius: 14px;
    box-shadow: var(--shadow-lg); margin-bottom: 24px; }
.hero h1 { color: #fff; font-size: 36px; margin-bottom: 12px; }
.hero p { font-size: 17px; opacity: 0.93; max-width: 720px; margin: 0 auto 22px; }
.hero .cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero .btn { background: #fff; color: var(--primary-dark); }
.hero .btn:hover { background: var(--bg); color: var(--primary-dark); }
.hero .btn-accent { background: var(--accent); color: #fff; }
.hero .btn-accent:hover { background: var(--accent-dark); color: #fff; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px; margin-top: 24px; }
.feature { background: #fff; border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); }
.feature .feat-icon { font-size: 28px; margin-bottom: 10px; }
.feature h3 { color: var(--primary-dark); margin-bottom: 6px; font-size: 16px; }
.feature p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ─── CHAPTER DASHBOARD ─── */
.section-header { display: flex; justify-content: space-between; align-items: center;
    margin: 26px 0 10px; }
.section-title { font-size: 13px; color: var(--accent-dark); font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px; }
.chapter-item { display: flex; align-items: center; justify-content: space-between;
    background: #fff; padding: 14px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
    text-decoration: none; color: var(--text); }
.chapter-item:hover { border-color: var(--accent); box-shadow: var(--shadow);
    text-decoration: none; color: var(--text); transform: translateY(-1px); }
.chapter-item .ch-num { color: var(--text-light); font-size: 13px; font-weight: 600;
    margin-right: 10px; min-width: 28px; }
.chapter-item .ch-name { flex: 1; font-size: 14px; font-weight: 500; line-height: 1.35; }
.chapter-item .ch-status { font-size: 11px; padding: 3px 7px; border-radius: 3px;
    font-weight: 600; margin-left: 8px; white-space: nowrap; }
.status-new { background: #eef2f7; color: var(--text-muted); }
.status-started { background: #fef3e1; color: #8a5900; }
.status-progress { background: #e5f0f9; color: var(--primary-dark); }
.status-mastered { background: #e9f7ee; color: var(--success); }

/* ─── LEARN CHAT ─── */
.learn-container { max-width: 820px; margin: 0 auto; }
.learn-header { background: #fff; padding: 14px 20px; border-radius: var(--radius);
    margin-bottom: 14px; box-shadow: var(--shadow); display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 10px; }
.learn-header .ch-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.learn-header .ch-meta { font-size: 12px; color: var(--text-muted); }

.msg { margin-bottom: 14px; }
.msg.ai .bubble { background: #fff; border: 1px solid var(--border); padding: 16px 18px;
    border-radius: var(--radius); border-top-left-radius: 3px; box-shadow: var(--shadow); }
.msg.user { text-align: right; }
.msg.user .bubble { background: var(--primary); color: #fff; display: inline-block;
    padding: 12px 16px; border-radius: var(--radius); border-top-right-radius: 3px;
    max-width: 85%; text-align: left; }
.msg .label { font-size: 11px; color: var(--text-light); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.msg.user .label { color: var(--accent); }

.fact-box { background: linear-gradient(135deg, #f0f9ff, #e5f0f9);
    border-left: 3px solid var(--accent); padding: 14px 16px;
    border-radius: var(--radius-sm); margin: 10px 0; }
.fact-box .fact-label { font-size: 11px; color: var(--accent-dark); font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 4px; }
.fact-box .fact-text { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.fact-box .fact-detail { font-size: 13px; color: var(--text-muted); }

.ypn-buttons { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ypn-buttons button { flex: 1; min-width: 100px; padding: 12px; font-size: 14px;
    font-weight: 600; border-radius: var(--radius-sm); border: 1.5px solid; cursor: pointer;
    background: #fff; transition: all 0.15s; }
.ypn-yes { border-color: var(--success); color: var(--success); }
.ypn-yes:hover { background: var(--success); color: #fff; }
.ypn-partial { border-color: var(--warn); color: #8a5900; }
.ypn-partial:hover { background: var(--warn); color: #fff; }
.ypn-no { border-color: var(--danger); color: var(--danger); }
.ypn-no:hover { background: var(--danger); color: #fff; }

.mcq-options { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mcq-option { padding: 11px 14px; background: #fff; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; transition: all 0.15s;
    text-align: left; }
.mcq-option:hover { border-color: var(--accent); background: #f0fbfa; }
.mcq-option.correct { border-color: var(--success); background: #e9f7ee; }
.mcq-option.wrong { border-color: var(--danger); background: #fbeaea; }

.ref-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ref-links a { font-size: 12px; padding: 5px 10px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); }
.ref-links a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.answer-input { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.answer-input textarea { width: 100%; min-height: 80px; padding: 11px; font-family: inherit;
    font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ─── TABLES ─── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
    font-size: 14px; }
th { background: var(--bg); font-weight: 600; color: var(--text-muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── DISCUSSION ─── */
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-item { background: #fff; padding: 14px 18px; border-radius: var(--radius);
    border: 1px solid var(--border); transition: all 0.15s; cursor: pointer;
    text-decoration: none; color: var(--text); display: block; }
.thread-item:hover { border-color: var(--accent); box-shadow: var(--shadow);
    text-decoration: none; color: var(--text); }
.thread-title { font-weight: 600; font-size: 15px; color: var(--primary-dark); }
.thread-meta { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.thread-preview { font-size: 13px; color: var(--text-muted); margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.reply { background: var(--bg); padding: 12px 14px; border-radius: var(--radius-sm);
    margin: 10px 0; border-left: 3px solid var(--accent); }
.reply-header { display: flex; justify-content: space-between; font-size: 12px;
    color: var(--text-muted); margin-bottom: 6px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 720px) {
    .topbar-inner { padding: 8px 12px; }
    .topnav { gap: 2px; }
    .topnav a { padding: 6px 9px; font-size: 13px; }
    .brand-tag { display: none; }
    main { padding: 16px 12px; }
    .hero h1 { font-size: 26px; }
    h1 { font-size: 22px; }
}

/* ─── FOOTER ─── */
footer { background: var(--primary-dark); color: #c8d6e8; padding: 20px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap;
    justify-content: space-between; gap: 10px; font-size: 13px; }
.footer-disclaimer { max-width: 1200px; margin: 14px auto 0; padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.12); font-size: 11.5px; line-height: 1.6;
    color: rgba(245, 239, 226, 0.7); font-style: italic; letter-spacing: 0.01em; }
.footer-disclaimer strong { color: #f5efe2; font-style: normal; font-weight: 600; }
footer a { color: #9ac0e5; }
footer a:hover { color: #fff; }

/* ─── UTILS ─── */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; }
.text-center { text-align: center; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px;
    font-weight: 600; background: var(--bg); }
.badge-success { background: #e9f7ee; color: var(--success); }
.badge-warn { background: #fef3e1; color: #8a5900; }
.badge-danger { background: #fbeaea; color: var(--danger); }
.badge-info { background: #e5f0f9; color: var(--primary-dark); }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Page header ─── */
.page-header { margin: 16px 0 22px; }
.page-header h1 { margin: 0 0 4px; font-size: 28px; color: var(--primary-dark); }
.page-header .subtitle { color: var(--text-muted); margin: 0; font-size: 15px; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--primary); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* ─── Alerts (extend existing) ─── */
.alert-error { background: #fbeaea; border: 1px solid var(--danger); color: var(--danger);
    padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }

/* ─── Discussion Board ─── */
.new-thread-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px; margin-bottom: 18px; }
.new-thread-card summary { cursor: pointer; list-style: none; }
.new-thread-card summary::-webkit-details-marker { display: none; }
.new-thread-card[open] summary { margin-bottom: 14px; }
.thread-form label { display: block; margin-bottom: 12px; font-weight: 600; }
.thread-form input, .thread-form textarea, .thread-form select {
    width: 100%; padding: 9px 11px; margin-top: 4px; border: 1px solid var(--border);
    border-radius: 6px; font-family: inherit; font-size: 14px; background: #fff;
}
.thread-form textarea { resize: vertical; min-height: 100px; }

.thread-list { display: flex; flex-direction: column; gap: 12px; }
.thread-card { display: block; background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px; text-decoration: none; color: inherit;
    transition: border-color 0.15s, transform 0.05s; }
.thread-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.thread-card h3 { margin: 4px 0 6px; color: var(--primary-dark); font-size: 17px; }
.thread-snippet { color: var(--text); margin: 0 0 10px; line-height: 1.45; font-size: 14px; }
.thread-meta { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 12px;
    flex-wrap: wrap; align-items: center; }
.thread-meta .author { color: var(--text); font-weight: 600; }
.thread-meta em { font-style: normal; color: var(--text-muted); font-weight: 400; }
.chip { background: var(--bg); border: 1px solid var(--border); padding: 2px 8px;
    border-radius: 10px; font-size: 11.5px; }
.pin-badge { display: inline-block; background: #fef3e1; color: #8a5900;
    padding: 1px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; margin-bottom: 6px; }

/* ─── Single Thread ─── */
.thread-detail { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 18px 22px; margin-bottom: 22px; }
.thread-detail h1 { margin: 0 0 10px; color: var(--primary-dark); font-size: 22px; }
.thread-body { margin-top: 14px; line-height: 1.6; font-size: 15px; }

.replies-heading { color: var(--primary-dark); margin: 18px 0 12px; font-size: 18px; }
.reply-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.reply { background: var(--card); border-left: 3px solid var(--primary);
    padding: 12px 16px; border-radius: 0 8px 8px 0; }
.reply-meta { font-size: 12.5px; margin-bottom: 6px; }
.reply-meta strong { color: var(--primary-dark); }
.reply-meta em { font-style: normal; color: var(--text-muted); font-weight: 400; }
.reply-meta .time { color: var(--text-muted); margin-left: 8px; }
.reply-body { line-height: 1.55; font-size: 14.5px; margin-bottom: 6px; }
.nested-replies { margin-top: 10px; margin-left: 16px; padding-left: 12px;
    border-left: 2px dashed var(--border); display: flex; flex-direction: column; gap: 10px; }
.comment-form { margin-top: 8px; padding: 10px; background: var(--bg); border-radius: 6px; }
.comment-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 6px;
    padding: 8px; font-family: inherit; font-size: 13.5px; }
.reply-form { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 18px; }
.reply-form h3 { margin: 0 0 10px; color: var(--primary-dark); }
.reply-form textarea { width: 100%; padding: 10px; border: 1px solid var(--border);
    border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; }

.btn-mini { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.btn-link { background: transparent; color: var(--primary); border: none; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.btn-ghost:hover { background: var(--bg); }

/* ─── Account / Grid layouts ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2 .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.balance-display { font-size: 48px; font-weight: 700; color: var(--primary-dark);
    line-height: 1; margin: 8px 0 4px; }
.rate-table { width: 100%; margin-top: 12px; font-size: 13.5px; }
.rate-table td { padding: 5px 0; border-bottom: 1px dashed var(--border); }
.rate-table td:last-child { text-align: right; font-weight: 600; color: var(--primary-dark); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.stat-grid .stat { background: var(--bg); padding: 10px; border-radius: 6px; text-align: center; }
.stat-grid .stat strong { display: block; font-size: 22px; color: var(--primary-dark); }
.stat-grid .stat span { font-size: 11.5px; color: var(--text-muted); }

.referral-card { background: linear-gradient(135deg, #f0fafa 0%, #e6f4f4 100%); }
.ref-link-box { display: flex; gap: 8px; margin: 10px 0; }
.ref-link-box input { flex: 1; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-family: 'Courier New', monospace; font-size: 13px; background: #fff; }
.ref-share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn-share { display: inline-block; padding: 8px 14px; border-radius: 6px;
    text-decoration: none; font-size: 13px; font-weight: 600; transition: opacity 0.15s; }
.btn-share:hover { opacity: 0.85; }
.btn-wa { background: #25D366; color: #fff; }
.btn-email { background: #555; color: #fff; }
.btn-copy { background: #0a66c2; color: #fff; }

.profile-form { display: block; }
.profile-form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.profile-form input { width: 100%; padding: 9px 11px; margin-top: 4px;
    border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 14px;
    background: #fff; }
.profile-form input:disabled { background: #f3f4f5; color: var(--text-muted); }

.txn-table { width: 100%; font-size: 13px; border-collapse: collapse; margin-top: 6px; }
.txn-table th, .txn-table td { padding: 7px 8px; border-bottom: 1px solid var(--border);
    text-align: left; }
.txn-table th { background: var(--bg); font-weight: 600; }
.txn-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.txn-table .pos { color: var(--success); font-weight: 600; }
.txn-table .neg { color: var(--danger); font-weight: 600; }
.txn-tag { display: inline-block; padding: 2px 7px; border-radius: 8px;
    font-size: 11px; text-transform: uppercase; }
.txn-bonus, .txn-admin_grant, .txn-referral { background: #e9f7ee; color: var(--success); }
.txn-usage { background: #fbeaea; color: var(--danger); }

/* ─── Admin ─── */
.admin-container { max-width: 1200px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; text-align: center; }
.kpi strong { display: block; font-size: 22px; color: var(--primary-dark); line-height: 1.1; }
.kpi span { font-size: 11.5px; color: var(--text-muted); }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label { font-size: 13px; font-weight: 600; }
.inline-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    margin-top: 4px; font-size: 13.5px; display: block; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 6px 9px; border-bottom: 1px solid var(--border);
    text-align: left; white-space: nowrap; }
.data-table th { background: var(--bg); font-weight: 600; position: sticky; top: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .admin-row { background: #fffbe7; }
.data-table code { background: var(--bg); padding: 1px 6px; border-radius: 4px;
    font-size: 12px; }
.doubt-feed { list-style: none; padding: 0; margin: 0; }
.doubt-feed li { border-bottom: 1px solid var(--border); padding: 10px 0; }
.doubt-feed li:last-child { border-bottom: 0; }
.doubt-feed li p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; }

/* ════════════════════════════════════════════════════════════
   SPECIALTY TOGGLE (registration form — pick NS or NL)
   ════════════════════════════════════════════════════════════ */
.spec-toggle {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.spec-opt {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 14px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    background: #fafbfc;
    transition: all 0.15s ease;
    position: relative;
}
.spec-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.spec-opt:hover {
    border-color: var(--primary, #0d3b66);
    background: #f0f7ff;
}
.spec-opt.sel {
    border-color: var(--primary, #0d3b66);
    background: #e6f0fa;
    box-shadow: 0 0 0 3px rgba(13,59,102,0.10);
}
.spec-opt .ico {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 4px;
}
.spec-opt strong {
    font-size: 15px;
    color: var(--primary-dark, #0a2f52);
}
.spec-opt em {
    font-size: 12px;
    color: #64748b;
    font-style: normal;
    line-height: 1.3;
}

/* ════════════════════════════════════════════════════════════
   VIEW TOGGLE (dashboard — My / Other / All)
   ════════════════════════════════════════════════════════════ */
.view-toggle {
    display: flex;
    gap: 10px;
    margin: 18px 0 12px;
    flex-wrap: wrap;
}
.vt-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 14px;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vt-btn strong {
    font-size: 14px;
    color: var(--primary-dark, #0a2f52);
    display: block;
}
.vt-btn em {
    font-size: 11.5px;
    color: #64748b;
    font-style: normal;
}
.vt-btn:hover {
    border-color: var(--primary, #0d3b66);
    background: #f5f9fc;
}
.vt-btn.on {
    border-color: var(--primary, #0d3b66);
    background: var(--primary, #0d3b66);
    box-shadow: 0 2px 8px rgba(13,59,102,0.18);
}
.vt-btn.on strong,
.vt-btn.on em {
    color: #ffffff;
}

/* ════════════════════════════════════════════════════════════
   SPECIALTY TAG (per-chapter badge — NS / NL / BOTH)
   ════════════════════════════════════════════════════════════ */
.spec-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.4;
    margin-right: 6px;
    vertical-align: middle;
    white-space: nowrap;
}
.spec-tag.ns {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.spec-tag.nl {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}
.spec-tag.bt {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Chapter items — ensure spec tag sits nicely before number */
.chapter-item .spec-tag {
    margin-right: 4px;
    flex-shrink: 0;
}

/* Alert variant for warnings (was missing) */
.alert-warn {
    background: #fff9eb;
    border: 1px solid #facc15;
    color: #854d0e;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 8px 0;
}

/* Empty state helper */
.empty-state {
    padding: 36px 20px;
    text-align: center;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    margin: 20px 0;
}

/* ════════════════════════════════════════════════════════════
   QUIZ-MODE FACT BOX (hides answer until Yes/Partial/No clicked)
   ════════════════════════════════════════════════════════════ */
.fact-box.quiz-mode {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border-left: 4px solid #d97706;
}
.fact-box.quiz-mode .fact-label::after {
    content: ' · ❓ TEST YOURSELF';
    color: #b45309;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.fact-box .quiz-question {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-style: italic;
    font-size: 15px;
    color: var(--ink, #1a1a1a);
    line-height: 1.5;
    border-left: 3px solid #d97706;
}
.fact-box .quiz-question::before {
    content: '🤔 ';
    margin-right: 4px;
}

/* Answered state — fact-box reveals the explanation */
.fact-box.answered {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-left: 4px solid #16a34a;
}
.fact-box.answered .fact-label::after {
    content: ' · ✓ ANSWER REVEALED';
    color: #15803d;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.fact-detail.revealed {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 3px solid #16a34a;
    animation: slideIn 0.4s ease;
    font-size: 13.5px;
    color: var(--text, #1f2937);
    line-height: 1.55;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════════
   PHASE 2 — Level dots on dashboard chapter cards
   ════════════════════════════════════════════════════════════════ */
.ch-level-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: auto;
    margin-right: 10px;
    align-self: center;
}
.lv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background 0.2s;
}
.lv-dot.on {
    background: #0d9488;
}
.chapter-item:hover .lv-dot:not(.on) { background: #d1d5db; }

/* "Mastered" status pill (chapters done) */
.ch-status.status-mastered {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #7c2d12;
    border: 1px solid #fbbf24;
    font-weight: 600;
}

/* Logo */
.brand { align-items: center; }
.brand-logo { height: 40px; width: auto; display: block; }
.hero-logo { display: block; text-align: center; margin: 0 auto 18px; }
.hero-logo img { width: 100%; max-width: 560px; height: auto; display: inline-block; }
@media (max-width: 640px) {
    .brand-logo { height: 32px; }
    .hero-logo img { max-width: 230px; border-radius: 24px; }
}

/* ─── Honeycomb mobile menu ─── */
.hive-btn, .hive { display: none; }
@media (max-width: 720px) {
    .topbar-inner { flex-wrap: nowrap; justify-content: space-between; }
    .hive-on .topnav { display: none !important; }
    .hive-on .hive-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
        border: 0; background: transparent; cursor: pointer; padding: 2px 6px; color: var(--primary-dark); }
    .hive-ico { font-size: 34px; line-height: 1; color: #0d9488; transition: transform .3s; }
    .hive-lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: -4px; }
    .hive-btn.open .hive-ico { transform: rotate(90deg) scale(1.1); color: #f0607f; }
    .hive { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
        border-bottom: 1px solid var(--border); box-shadow: 0 14px 28px rgba(0,0,0,.14);
        padding: 14px 8px 12px; max-height: calc(100vh - 70px); overflow-y: auto;
        opacity: 0; transform: translateY(-8px); transition: opacity .22s, transform .22s; }
    .hive[hidden] { display: none; }
    .hive.show { opacity: 1; transform: none; }
    .hive-row { display: flex; justify-content: center; gap: 6px; margin-top: -22px; }
    .hive-row:first-child { margin-top: 0; }
    .hex { display: block; width: 96px; height: 108px; text-decoration: none !important; color: #fff !important;
        clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
        background: linear-gradient(145deg, #0d9488, #0a6f66); transform: scale(.2); opacity: 0;
        transition: transform .3s cubic-bezier(.2,.9,.3,1.3), opacity .25s; }
    .hive.show .hex { transform: scale(1); opacity: 1; }
    .hex:nth-child(even) { background: linear-gradient(145deg, #1e4f8a, #0a1d2e); }
    .hex.hex-admin { background: linear-gradient(145deg, #f59e0b, #b45309); }
    .hex.hex-credit { background: linear-gradient(145deg, #ff7a8a, #f0607f); }
    .hex:active { filter: brightness(1.15); }
    .hex-in { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 0 12px; text-align: center; }
    .hex-i { font-size: 26px; line-height: 1.1; }
    .hex-l { font-size: 11.5px; font-weight: 700; line-height: 1.15; margin-top: 3px; }
    .hive-extras { text-align: center; padding-top: 10px; }
    .hive-extras a { color: var(--text-muted); font-size: 13px; padding: 6px 14px; }
}
