/**
 * TNPSC Study Materials — Public Stylesheet
 * Phase 1 — Core CRUD
 */

/* ========================================
   SHARED CONTAINER
   ======================================== */

.tnpsc-sm-single,
.tnpsc-sm-archive {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #1d2327;
}

/* ========================================
   SINGLE MATERIAL
   ======================================== */

.tnpsc-sm-breadcrumb {
    font-size: 14px;
    color: #50575e;
    margin-bottom: 16px;
}

.tnpsc-sm-breadcrumb a {
    color: #2271b1;
    text-decoration: none;
}

.tnpsc-sm-breadcrumb a:hover {
    text-decoration: underline;
}

.tnpsc-sm-breadcrumb span {
    margin: 0 6px;
    color: #8c8f94;
}

.tnpsc-sm-material-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.tnpsc-sm-material-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
}

.tnpsc-sm-topic-code code {
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
}

/* ========================================
   LANGUAGE TOGGLE (Phase 2 — button style)
   ======================================== */

.tnpsc-sm-lang-toggle {
    display: inline-flex;
    align-items: stretch;
    background: #f0f0f1;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    margin-left: auto;
}

.tnpsc-sm-lang-toggle .tnpsc-sm-lang-divider {
    display: none;
}

.tnpsc-sm-lang-toggle a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 40px;
    padding: 8px 16px;
    color: #50575e;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.tnpsc-sm-lang-toggle a:hover {
    background: rgba(34, 113, 177, 0.08);
    color: #2271b1;
}

.tnpsc-sm-lang-toggle a.active {
    background: #2271b1;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tnpsc-sm-lang-toggle a.active:hover {
    background: #135e96;
    color: #fff;
}

.tnpsc-sm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    color: #50575e;
}

/* Mobile: full-width toggle for better thumb reach */
@media (max-width: 640px) {
    .tnpsc-sm-meta {
        gap: 12px;
    }
    .tnpsc-sm-lang-toggle {
        margin-left: 0;
        width: 100%;
    }
    .tnpsc-sm-lang-toggle a {
        flex: 1;
        min-height: 44px;
        font-size: 16px;
    }
}

/* ========================================
   MARKDOWN CONTENT — TABLES, BLOCKQUOTES, CODE
   ======================================== */

.tnpsc-sm-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
}

.tnpsc-sm-content th,
.tnpsc-sm-content td {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.tnpsc-sm-content th {
    background: #f6f7f7;
    font-weight: 600;
    color: #1d2327;
}

.tnpsc-sm-content tbody tr:nth-child(even) {
    background: #fafafa;
}

.tnpsc-sm-content blockquote {
    border-left: 4px solid #2271b1;
    background: #f6f7f7;
    margin: 20px 0;
    padding: 12px 18px;
    color: #3c434a;
    font-style: italic;
}

.tnpsc-sm-content blockquote p {
    margin: 0;
}

.tnpsc-sm-content code {
    background: #f0f0f1;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.tnpsc-sm-content pre {
    background: #1d2327;
    color: #f0f0f1;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
}

.tnpsc-sm-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 14px;
}

.tnpsc-sm-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 30px 0;
}

.tnpsc-sm-content a {
    color: #2271b1;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.tnpsc-sm-content a:hover {
    color: #135e96;
}

.tnpsc-sm-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   TAMIL CONTENT — better font rendering
   ======================================== */

[lang="ta"],
.tnpsc-sm-content--ta,
.tnpsc-sm-content--ta * {
    font-family: "Noto Sans Tamil", "Latha", "Tamil Sangam MN", sans-serif;
    line-height: 1.85;
}

.tnpsc-sm-card-tamil-title {
    font-family: "Noto Sans Tamil", "Latha", "Tamil Sangam MN", sans-serif;
}


.tnpsc-sm-summary {
    font-size: 17px;
    color: #3c434a;
    font-style: italic;
    margin-top: 12px;
}

.tnpsc-sm-sources {
    background: #f6f7f7;
    border-left: 4px solid #2271b1;
    padding: 16px 20px;
    margin: 20px 0 30px;
    border-radius: 0 4px 4px 0;
}

.tnpsc-sm-sources h2 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #1d2327;
}

.tnpsc-sm-sources ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
}

.tnpsc-sm-content h2 {
    font-size: 26px;
    margin-top: 40px;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e7eb;
}

.tnpsc-sm-content h3 {
    font-size: 20px;
    margin-top: 28px;
    margin-bottom: 10px;
    color: #2271b1;
}

.tnpsc-sm-content ul {
    padding-left: 24px;
}

.tnpsc-sm-content li {
    margin-bottom: 8px;
}

.tnpsc-sm-pyq-inline {
    display: inline-block;
    background: #fff3cd;
    color: #664d03;
    font-size: 12px;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 3px;
    font-weight: 500;
}

.tnpsc-sm-pyq {
    margin-top: 40px;
    padding: 20px;
    background: #fff8e1;
    border-radius: 6px;
}

.tnpsc-sm-pyq h2 {
    margin-top: 0;
    font-size: 20px;
}

.tnpsc-sm-pyq ul {
    margin: 0;
    padding-left: 20px;
}

.tnpsc-sm-pyq-tag {
    display: inline-block;
    background: #fff;
    border: 1px solid #ddd;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 12px;
    border-radius: 3px;
    color: #50575e;
}

.tnpsc-sm-practice-cta {
    margin-top: 40px;
    padding: 32px 28px;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0faff 50%, #fff5e6 100%);
    border: 2px solid #1877f2;
    border-radius: 14px;
    text-align: center;
    box-shadow:
        0 4px 16px rgba(24, 119, 242, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}
.tnpsc-sm-practice-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(24, 119, 242, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.tnpsc-sm-practice-cta h3 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #1c1e21;
    font-weight: 700;
}

.tnpsc-sm-practice-cta p {
    margin: 0 0 18px;
    color: #4b4f56;
    font-size: 15px;
    line-height: 1.6;
}

.tnpsc-sm-practice-cta .tnpsc-sm-btn-primary,
.tnpsc-sm-practice-cta a.tnpsc-sm-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #1877f2 0%, #0866ff 50%, #0758dc 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    box-shadow:
        0 4px 14px rgba(24, 119, 242, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
}
.tnpsc-sm-practice-cta .tnpsc-sm-btn-primary:hover {
    background: linear-gradient(135deg, #2186ff 0%, #1077ff 50%, #0866ff 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow:
        0 8px 22px rgba(24, 119, 242, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tnpsc-sm-practice-cta-soft {
    background: linear-gradient(135deg, #f6f7f8 0%, #f0f2f5 100%);
    border-color: #d8dde3;
    box-shadow: none;
}
.tnpsc-sm-practice-cta-soft h3 { color: #65676b; }

/* ========================================
   ARCHIVE / INDEX
   ======================================== */

.tnpsc-sm-archive-header {
    text-align: center;
    margin-bottom: 30px;
}

.tnpsc-sm-archive-header h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

.tnpsc-sm-archive-tagline {
    color: #50575e;
    font-size: 17px;
    margin-bottom: 4px;
}

.tnpsc-sm-archive-count {
    color: #8c8f94;
    font-size: 14px;
}

.tnpsc-sm-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tnpsc-sm-material-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tnpsc-sm-material-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tnpsc-sm-material-card h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.tnpsc-sm-material-card h2 a {
    color: #1d2327;
    text-decoration: none;
}

.tnpsc-sm-material-card h2 a:hover {
    color: #2271b1;
}

.tnpsc-sm-card-tamil-title {
    color: #646970;
    font-size: 14px;
    margin: 0 0 8px;
}

.tnpsc-sm-card-meta {
    font-size: 12px;
    color: #8c8f94;
    margin: 8px 0;
}

.tnpsc-sm-card-meta code {
    background: #f0f0f1;
    padding: 1px 6px;
    border-radius: 3px;
}

.tnpsc-sm-card-summary {
    font-size: 14px;
    color: #50575e;
    margin: 10px 0;
}

.tnpsc-sm-card-link {
    display: inline-block;
    margin-top: 10px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.tnpsc-sm-card-link:hover {
    text-decoration: underline;
}

.tnpsc-sm-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8c8f94;
    font-size: 16px;
}

.tnpsc-sm-404 {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    padding: 0 20px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .tnpsc-sm-material-header h1 {
        font-size: 26px;
    }
    .tnpsc-sm-archive-header h1 {
        font-size: 28px;
    }
}

/* =============================================================================
   PHASE 5: SEARCH, TOC, READING TIME, PREV/NEXT, SHARE
   ========================================================================== */

/* Reading time pill */
.tnpsc-sm-reading-time {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: #f0f2f5;
    color: #65676b;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* Share buttons */
.tnpsc-sm-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.tnpsc-sm-share-label {
    color: #65676b;
    font-size: 13px;
    font-weight: 500;
}
.tnpsc-sm-share-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 18px;
    text-decoration: none;
    border: 1px solid #d8dde3;
    background: #fff;
    color: #1c1e21;
    cursor: pointer;
    transition: all 0.15s;
}
.tnpsc-sm-share-btn:hover {
    background: #f6f7f8;
    border-color: #b0b3b8;
    color: #1c1e21;
}
.tnpsc-sm-share-whatsapp:hover { color: #25d366; border-color: #25d366; }
.tnpsc-sm-share-twitter:hover { color: #1da1f2; border-color: #1da1f2; }
.tnpsc-sm-share-copy.is-copied {
    background: #e9f7e7;
    border-color: #42b72a;
    color: #2d8316;
}

/* Content wrapper with sidebar TOC */
.tnpsc-sm-content-wrapper {
    display: block;
}
.tnpsc-sm-content-wrapper.has-toc {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}
.tnpsc-sm-content-main {
    min-width: 0;
}

/* TOC */
.tnpsc-sm-toc {
    position: sticky;
    top: 20px;
    background: #f6f7f8;
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.tnpsc-sm-toc-title {
    font-size: 12px;
    font-weight: 700;
    color: #65676b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}
.tnpsc-sm-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tnpsc-sm-toc-item {
    padding: 4px 0;
    line-height: 1.4;
}
.tnpsc-sm-toc-item.tnpsc-sm-toc-level-3 {
    padding-left: 14px;
    font-size: 12px;
}
.tnpsc-sm-toc-item a {
    color: #65676b;
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 8px;
    display: block;
    transition: all 0.15s;
}
.tnpsc-sm-toc-item a:hover,
.tnpsc-sm-toc-item a.is-active {
    color: #1877f2;
    border-left-color: #1877f2;
}

/* Prev/Next sibling navigation */
.tnpsc-sm-sibling-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #d8dde3;
}
.tnpsc-sm-sibling-prev,
.tnpsc-sm-sibling-next {
    display: block;
    padding: 16px 20px;
    background: #f6f7f8;
    border-radius: 8px;
    text-decoration: none;
    color: #1c1e21;
    transition: all 0.15s;
}
.tnpsc-sm-sibling-prev:hover,
.tnpsc-sm-sibling-next:hover {
    background: #e7f3ff;
    color: #1877f2;
}
.tnpsc-sm-sibling-next { text-align: right; }
.tnpsc-sm-sibling-direction {
    display: block;
    font-size: 12px;
    color: #65676b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.tnpsc-sm-sibling-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.tnpsc-sm-sibling-spacer { display: block; }

/* Heading anchors (TOC scroll target) */
.tnpsc-sm-content h2[id],
.tnpsc-sm-content h3[id] {
    scroll-margin-top: 20px;
}

/* Search page */
.tnpsc-sm-search {
    max-width: 800px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tnpsc-sm-search-header h1 {
    font-size: 28px;
    margin: 0 0 20px;
}
.tnpsc-sm-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.tnpsc-sm-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid #d8dde3;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}
.tnpsc-sm-search-input:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}
.tnpsc-sm-search-btn {
    padding: 12px 28px;
    background: #1877f2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.tnpsc-sm-search-btn:hover { background: #166fe5; }

.tnpsc-sm-search-meta {
    color: #65676b;
    font-size: 14px;
    margin-bottom: 20px;
}
.tnpsc-sm-search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #65676b;
}
.tnpsc-sm-search-empty h2 {
    color: #1c1e21;
    font-size: 22px;
    margin-bottom: 12px;
}

.tnpsc-sm-search-results {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tnpsc-sm-search-result {
    border-bottom: 1px solid #e4e6eb;
    padding: 20px 0;
}
.tnpsc-sm-search-result:last-child { border-bottom: none; }
.tnpsc-sm-search-result-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.tnpsc-sm-search-result-title {
    font-size: 18px;
    margin: 0 0 6px;
    color: #1877f2;
}
.tnpsc-sm-search-result-link:hover .tnpsc-sm-search-result-title {
    text-decoration: underline;
}
.tnpsc-sm-search-result-code {
    font-size: 12px;
    color: #65676b;
    font-family: monospace;
    margin-bottom: 6px;
}
.tnpsc-sm-search-result-snippet {
    color: #1c1e21;
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}
.tnpsc-sm-search-results mark {
    background: #fff3cd;
    padding: 0 2px;
    font-weight: 600;
}

.tnpsc-sm-search-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #d8dde3;
}
.tnpsc-sm-page-link {
    color: #1877f2;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
}
.tnpsc-sm-page-link:hover { background: #e7f3ff; }
.tnpsc-sm-page-info {
    color: #65676b;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 768px) {
    .tnpsc-sm-content-wrapper.has-toc {
        grid-template-columns: 1fr;
    }
    .tnpsc-sm-toc {
        position: static;
        max-height: none;
        margin-bottom: 20px;
    }
    .tnpsc-sm-sibling-nav {
        grid-template-columns: 1fr;
    }
    .tnpsc-sm-sibling-next { text-align: left; }
}

/* =============================================================================
   PHASE 6: 👍👎 Feedback widget
   ========================================================================== */

.tnpsc-sm-feedback-widget {
    margin: 32px 0;
    padding: 24px;
    background: #f6f7f8;
    border-radius: 12px;
    text-align: center;
}

.tnpsc-sm-feedback-prompt h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 600;
    color: #1c1e21;
}

.tnpsc-sm-feedback-buttons {
    display: inline-flex;
    gap: 12px;
    margin-bottom: 8px;
}

.tnpsc-sm-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1.5px solid #d8dde3;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1c1e21;
    transition: all 0.15s;
}
.tnpsc-sm-vote-btn:hover {
    border-color: #b0b3b8;
    background: #f0f2f5;
    transform: translateY(-1px);
}
.tnpsc-sm-vote-icon { font-size: 18px; }
.tnpsc-sm-vote-count {
    background: #f0f2f5;
    color: #65676b;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}
.tnpsc-sm-vote-up.is-selected {
    border-color: #42b72a;
    background: #e9f7e7;
    color: #2d8316;
}
.tnpsc-sm-vote-up.is-selected .tnpsc-sm-vote-count {
    background: #42b72a;
    color: #fff;
}
.tnpsc-sm-vote-down.is-selected {
    border-color: #d32f2f;
    background: #fdeaea;
    color: #b00020;
}
.tnpsc-sm-vote-down.is-selected .tnpsc-sm-vote-count {
    background: #d32f2f;
    color: #fff;
}

.tnpsc-sm-feedback-stats {
    margin: 6px 0 0;
    font-size: 12px;
    color: #65676b;
}

.tnpsc-sm-feedback-thanks {
    padding: 16px;
    font-size: 15px;
    color: #2d8316;
    font-weight: 500;
}

.tnpsc-sm-feedback-comment {
    margin-top: 16px;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.tnpsc-sm-feedback-comment label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
    margin-bottom: 6px;
}
.tnpsc-sm-feedback-comment textarea {
    width: 100%;
    padding: 10px;
    border: 1.5px solid #d8dde3;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}
.tnpsc-sm-feedback-comment textarea:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}
.tnpsc-sm-feedback-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

/* =============================================================================
   PHASE 7: Reading progress bar
   ========================================================================== */

.tnpsc-sm-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}
.tnpsc-sm-reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1877f2 0%, #42b72a 100%);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* =============================================================================
   PHASE 7: Bookmark + print buttons (extend share button styles)
   ========================================================================== */

.tnpsc-sm-bookmark-btn .tnpsc-sm-bookmark-icon {
    font-size: 16px;
    line-height: 1;
}
.tnpsc-sm-bookmark-btn.is-saved {
    background: #fff5d5;
    color: #c47100;
    border-color: #f0c419;
}
.tnpsc-sm-bookmark-btn:hover {
    color: #c47100;
    border-color: #f0c419;
}

.tnpsc-sm-print-btn:hover {
    color: #1c1e21;
    border-color: #65676b;
}

/* =============================================================================
   PHASE 7: Related topics
   ========================================================================== */

.tnpsc-sm-related-topics {
    margin: 40px 0 24px;
    padding: 24px 0;
    border-top: 1px solid #d8dde3;
}
.tnpsc-sm-related-topics h2 {
    font-size: 18px;
    margin: 0 0 16px;
    color: #1c1e21;
}
.tnpsc-sm-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.tnpsc-sm-related-card {
    display: block;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #d8dde3;
    border-radius: 10px;
    text-decoration: none;
    color: #1c1e21;
    transition: all 0.15s;
}
.tnpsc-sm-related-card:hover {
    border-color: #1877f2;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(24, 119, 242, 0.12);
}
.tnpsc-sm-related-code {
    font-family: monospace;
    font-size: 11px;
    color: #65676b;
    margin-bottom: 4px;
}
.tnpsc-sm-related-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1c1e21;
    line-height: 1.35;
}
.tnpsc-sm-related-summary {
    font-size: 12px;
    color: #65676b;
    margin: 0;
    line-height: 1.45;
}

/* =============================================================================
   PHASE 7: My Progress dashboard
   ========================================================================== */

.tnpsc-sm-progress {
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tnpsc-sm-progress-header h1 {
    font-size: 26px;
    margin: 0 0 4px;
}
.tnpsc-sm-progress-subtitle {
    color: #65676b;
    margin: 0 0 24px;
    font-size: 15px;
}

.tnpsc-sm-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f6f7f8;
    border-radius: 12px;
}
.tnpsc-sm-empty-state h2 {
    font-size: 20px;
    margin: 0 0 8px;
}
.tnpsc-sm-empty-state p {
    color: #65676b;
    margin: 0 0 16px;
}

.tnpsc-sm-progress-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.tnpsc-sm-progress-card {
    background: #fff;
    border: 1px solid #d8dde3;
    border-radius: 10px;
    padding: 16px 18px;
    text-align: center;
}
.tnpsc-sm-progress-num {
    font-size: 26px;
    font-weight: 700;
    color: #1c1e21;
    line-height: 1.1;
}
.tnpsc-sm-progress-label {
    font-size: 12px;
    color: #65676b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.tnpsc-sm-progress-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .tnpsc-sm-progress-grid { grid-template-columns: 1fr; }
}

.tnpsc-sm-progress-section {
    background: #fff;
    border: 1px solid #d8dde3;
    border-radius: 12px;
    padding: 20px;
}
.tnpsc-sm-progress-section-wide { grid-column: 1 / -1; }
.tnpsc-sm-progress-section h2 {
    font-size: 17px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tnpsc-sm-pill {
    display: inline-block;
    padding: 2px 10px;
    background: #e7f3ff;
    color: #1877f2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tnpsc-sm-attempts-list,
.tnpsc-sm-best-list,
.tnpsc-sm-bookmark-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tnpsc-sm-attempt-item,
.tnpsc-sm-best-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}
.tnpsc-sm-attempt-item:last-child,
.tnpsc-sm-best-item:last-child { border-bottom: none; }

.tnpsc-sm-attempt-main strong a,
.tnpsc-sm-best-info a {
    color: #1c1e21;
    text-decoration: none;
}
.tnpsc-sm-attempt-main strong a:hover,
.tnpsc-sm-best-info a:hover { color: #1877f2; }

.tnpsc-sm-attempt-meta,
.tnpsc-sm-best-meta {
    display: block;
    font-size: 12px;
    color: #65676b;
    margin-top: 2px;
}
.tnpsc-sm-attempt-meta code,
.tnpsc-sm-best-meta code { font-size: 11px; }

.tnpsc-sm-attempt-score,
.tnpsc-sm-best-score {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.tnpsc-sm-score-excellent { background: #e9f7e7; color: #2d8316; }
.tnpsc-sm-score-good      { background: #e7f3ff; color: #1877f2; }
.tnpsc-sm-score-fair      { background: #fff3cd; color: #856404; }
.tnpsc-sm-score-needs-work { background: #fdeaea; color: #b00020; }

.tnpsc-sm-tag-progress {
    background: #fff3cd;
    color: #856404;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.tnpsc-sm-bookmark-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #f6f7f8;
    border-radius: 8px;
    transition: all 0.15s;
}
.tnpsc-sm-bookmark-item:hover { background: #e7f3ff; }
.tnpsc-sm-bookmark-item a {
    display: block;
    text-decoration: none;
    color: #1c1e21;
}
.tnpsc-sm-bookmark-meta {
    display: block;
    font-size: 12px;
    color: #65676b;
    margin-top: 2px;
}

.tnpsc-sm-muted { color: #65676b; }

/* =============================================================================
   PHASE 7: Print stylesheet (clean PDF export via browser)
   ========================================================================== */

@media print {
    /* Hide everything that's noise on paper */
    .tnpsc-sm-reading-progress,
    .tnpsc-sm-breadcrumb,
    .tnpsc-sm-share,
    .tnpsc-sm-toc,
    .tnpsc-sm-lang-toggle,
    .tnpsc-sm-practice-cta,
    .tnpsc-sm-sibling-nav,
    .tnpsc-sm-feedback-widget,
    .tnpsc-sm-related-topics,
    #wpadminbar,
    nav,
    header.site-header,
    footer.site-footer,
    .ast-primary-header-bar,
    .site-footer,
    .menu-toggle,
    .ast-mobile-header-content,
    aside.widget-area {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.45;
    }

    .tnpsc-sm-single {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    .tnpsc-sm-material-header h1 {
        font-size: 22pt;
        margin-bottom: 8pt;
        page-break-after: avoid;
    }
    .tnpsc-sm-meta {
        color: #555;
        font-size: 10pt;
        margin-bottom: 12pt;
    }
    .tnpsc-sm-summary {
        font-style: italic;
        margin-bottom: 12pt;
    }

    .tnpsc-sm-content-wrapper.has-toc {
        grid-template-columns: 1fr !important;
    }

    .tnpsc-sm-content {
        font-size: 11pt;
        line-height: 1.55;
    }
    .tnpsc-sm-content h2 {
        font-size: 15pt;
        margin-top: 14pt;
        page-break-after: avoid;
    }
    .tnpsc-sm-content h3 {
        font-size: 13pt;
        margin-top: 10pt;
        page-break-after: avoid;
    }
    .tnpsc-sm-content p {
        orphans: 3;
        widows: 3;
    }
    .tnpsc-sm-content a {
        color: #000 !important;
        text-decoration: underline;
    }
    .tnpsc-sm-content img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .tnpsc-sm-sources,
    .tnpsc-sm-pyq {
        border-top: 1px solid #000;
        padding-top: 8pt;
        margin-top: 14pt;
        page-break-inside: avoid;
    }

    /* Add URL after links */
    .tnpsc-sm-content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
    }
}

/* =============================================================================
   v0.6.1: Redesigned /study/ index page
   ========================================================================== */

.tnpsc-sm-archive-v2 {
    max-width: 1100px;
    margin: 0 auto 64px;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Archive header ---- */
.tnpsc-sm-archive-header {
    text-align: center;
    padding: 40px 0 0;
}
.tnpsc-sm-archive-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1c1e21;
}
.tnpsc-sm-archive-tagline {
    color: #65676b;
    font-size: 16px;
    margin: 0;
}

/* ---- Hero search ---- */
.tnpsc-sm-hero-search {
    text-align: center;
    margin: 28px 0 28px;
}
.tnpsc-sm-hero-search-form {
    display: flex;
    max-width: 620px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    border: 1.5px solid #d8dde3;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.tnpsc-sm-hero-search-form:focus-within {
    border-color: #1877f2;
    box-shadow: 0 4px 24px rgba(24, 119, 242, 0.18);
}
.tnpsc-sm-hero-search-input {
    flex: 1;
    padding: 15px 18px;
    font-size: 15px;
    border: none;
    outline: none;
    background: #fff;
    color: #1c1e21;
    min-width: 0;
}
.tnpsc-sm-hero-search-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #1877f2 0%, #0858d4 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.tnpsc-sm-hero-search-btn:hover {
    background: linear-gradient(135deg, #2480ff 0%, #1069e8 100%);
}
.tnpsc-sm-archive-count {
    margin: 10px 0 0;
    color: #9ca0a6;
    font-size: 13px;
}

/* ---- Quick jump dropdowns ---- */
.tnpsc-sm-quick-jump {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 14px;
    padding: 18px 22px 20px;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.tnpsc-sm-quick-jump h2 {
    font-size: 11px;
    font-weight: 700;
    color: #9ca0a6;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 12px;
}
.tnpsc-sm-quick-jump-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.tnpsc-sm-quick-jump-controls select {
    flex: 1;
    min-width: 180px;
    padding: 11px 36px 11px 14px;
    font-size: 14px;
    border: 1.5px solid #d8dde3;
    border-radius: 10px;
    background: #fff;
    color: #1c1e21;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tnpsc-sm-quick-jump-controls select:focus {
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}
.tnpsc-sm-quick-jump-controls select:disabled {
    background-color: #f7f8fa;
    color: #b0b3b8;
    cursor: not-allowed;
}
.tnpsc-sm-quick-go-btn {
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #1877f2 0%, #0858d4 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.25);
}
.tnpsc-sm-quick-go-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2480ff 0%, #1069e8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.35);
}
.tnpsc-sm-quick-go-btn:disabled {
    background: #d8dde3;
    box-shadow: none;
    cursor: not-allowed;
    color: #9ca0a6;
}

/* ---- Personal history ---- */
.tnpsc-sm-history {
    margin-bottom: 32px;
}
.tnpsc-sm-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.tnpsc-sm-history-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1c1e21;
}
.tnpsc-sm-history-all-link {
    font-size: 13px;
    color: #1877f2;
    text-decoration: none;
    font-weight: 500;
}
.tnpsc-sm-history-all-link:hover { text-decoration: underline; }

.tnpsc-sm-history-row { margin-bottom: 20px; }
.tnpsc-sm-history-subhead {
    font-size: 12px;
    color: #65676b;
    font-weight: 700;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tnpsc-sm-history-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}
.tnpsc-sm-history-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    text-decoration: none;
    color: #1c1e21;
    transition: all 0.15s;
    border-left: 4px solid #e4e6eb;
}
.tnpsc-sm-history-card:hover {
    border-color: #1877f2;
    border-left-color: #1877f2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.1);
}
.tnpsc-sm-history-card-code {
    font-family: monospace;
    font-size: 11px;
    color: #9ca0a6;
    background: #f0f2f5;
    padding: 2px 7px;
    border-radius: 5px;
    align-self: flex-start;
}
.tnpsc-sm-history-card strong {
    font-size: 13px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.4;
}
.tnpsc-sm-history-card-meta {
    font-size: 12px;
    color: #9ca0a6;
    margin-top: 2px;
}
.tnpsc-sm-history-card-bookmark   { border-left-color: #f0c419; }
.tnpsc-sm-history-card-bookmark:hover { border-color: #f0c419; box-shadow: 0 6px 16px rgba(240, 196, 25, 0.15); }
.tnpsc-sm-history-card-attempt.tnpsc-sm-score-excellent { border-left-color: #2d8316; }
.tnpsc-sm-history-card-attempt.tnpsc-sm-score-good      { border-left-color: #1877f2; }
.tnpsc-sm-history-card-attempt.tnpsc-sm-score-fair      { border-left-color: #e6900a; }
.tnpsc-sm-history-card-attempt.tnpsc-sm-score-needs-work { border-left-color: #d32f2f; }

/* ---- Login prompt ---- */
.tnpsc-sm-login-prompt {
    margin: 0 0 28px;
    padding: 16px 22px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border: 1px solid #cce0f5;
    border-radius: 12px;
    text-align: center;
}
.tnpsc-sm-login-prompt p {
    margin: 0;
    font-size: 14px;
    color: #1c1e21;
}
.tnpsc-sm-login-link {
    color: #1877f2;
    font-weight: 600;
    text-decoration: none;
    margin-left: 6px;
}
.tnpsc-sm-login-link:hover { text-decoration: underline; }

/* ---- Browse by subject tiles ---- */
.tnpsc-sm-subjects-section { margin-bottom: 36px; }
.tnpsc-sm-subjects-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1c1e21;
}
.tnpsc-sm-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.tnpsc-sm-subject-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 18px 14px;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 14px;
    text-decoration: none;
    color: #1c1e21;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}
.tnpsc-sm-subject-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1877f2, #42b72a);
    opacity: 0;
    transition: opacity 0.15s;
}
.tnpsc-sm-subject-tile:hover {
    border-color: #1877f2;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.12);
}
.tnpsc-sm-subject-tile:hover::before { opacity: 1; }
.tnpsc-sm-subject-tile-num {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 11px;
    color: #b0b3b8;
    font-weight: 600;
}
.tnpsc-sm-subject-tile strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.35;
    padding-right: 28px;
}
.tnpsc-sm-subject-tile-ta {
    display: block;
    font-size: 13px;
    color: #65676b;
    line-height: 1.4;
}
.tnpsc-sm-subject-tile-count {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    background: #e7f3ff;
    color: #1877f2;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
}

/* ---- Recently published ---- */
.tnpsc-sm-recent-published h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1c1e21;
}
.tnpsc-sm-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.tnpsc-sm-material-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 14px;
    padding: 18px 20px 16px;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tnpsc-sm-material-card:hover {
    border-color: #1877f2;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}
.tnpsc-sm-material-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.tnpsc-sm-material-card h3 a {
    color: #1c1e21;
    text-decoration: none;
}
.tnpsc-sm-material-card h3 a:hover { color: #1877f2; }
.tnpsc-sm-material-card-ta {
    margin: 0;
    font-size: 13px;
    color: #65676b;
    line-height: 1.4;
}
.tnpsc-sm-material-card-meta {
    margin: 0;
    font-size: 12px;
    color: #9ca0a6;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tnpsc-sm-material-card-meta code {
    font-size: 11px;
    background: #f0f2f5;
    padding: 2px 7px;
    border-radius: 5px;
    color: #65676b;
}
.tnpsc-sm-material-card-read {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
}
.tnpsc-sm-material-card-read:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .tnpsc-sm-archive-header h1 { font-size: 26px; }
    .tnpsc-sm-hero-search-form { flex-direction: column; border-radius: 12px; }
    .tnpsc-sm-hero-search-input { border-radius: 10px 10px 0 0; }
    .tnpsc-sm-hero-search-btn { border-radius: 0 0 10px 10px; justify-content: center; }
    .tnpsc-sm-quick-jump-controls { flex-direction: column; }
    .tnpsc-sm-quick-jump-controls select { min-width: 0; width: 100%; }
    .tnpsc-sm-quick-go-btn { width: 100%; }
    .tnpsc-sm-history-cards { grid-template-columns: 1fr 1fr; }
    .tnpsc-sm-subjects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
    .tnpsc-sm-history-cards { grid-template-columns: 1fr; }
    .tnpsc-sm-subjects-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   v0.6.4: Study completion progress bar
   ========================================================================== */

.tnpsc-sm-study-progress-bar-wrap {
    background: linear-gradient(135deg, #fff 0%, #f8faff 100%);
    border: 1px solid #e4e6eb;
    border-radius: 14px;
    padding: 18px 22px 14px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}
.tnpsc-sm-study-progress-bar-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    right: 0; height: 3px;
    background: linear-gradient(90deg, #1877f2 0%, #42b72a 100%);
}
.tnpsc-sm-study-progress-bar-wrap--dashboard {
    margin-bottom: 28px;
    padding: 22px 26px 18px;
}

.tnpsc-sm-study-progress-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}
.tnpsc-sm-study-progress-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
}
.tnpsc-sm-study-progress-bar-pct {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #1877f2, #42b72a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    min-width: 52px;
    text-align: right;
}

.tnpsc-sm-study-progress-track {
    height: 10px;
    background: #e4e6eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}
.tnpsc-sm-study-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1877f2 0%, #2ecc71 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.tnpsc-sm-study-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 20px; height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    animation: tnpsc-sm-progress-shimmer 2s infinite;
}
@keyframes tnpsc-sm-progress-shimmer {
    0%   { opacity: 0; transform: scaleX(0); }
    50%  { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(0); }
}

.tnpsc-sm-study-progress-sub {
    margin: 0;
    font-size: 12px;
    color: #65676b;
}

/* Highlight card for topics read */
.tnpsc-sm-progress-card--highlight {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-color: #cce0f5 !important;
}
.tnpsc-sm-progress-num-total {
    font-size: 14px;
    font-weight: 500;
    color: #9ca0a6;
}

/* =============================================================================
   v0.8.0: Premium Paywall
   ========================================================================== */

.tnpsc-sm-paywall-wrap {
    position: relative;
    margin: 24px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e4e6eb;
}

.tnpsc-sm-paywall-preview {
    position: relative;
    max-height: 120px;
    overflow: hidden;
    padding: 20px 24px 0;
    background: #fff;
}
.tnpsc-sm-paywall-preview-text {
    font-size: 14px;
    line-height: 1.6;
    color: #1c1e21;
    margin: 0;
    filter: blur(3px);
    user-select: none;
    pointer-events: none;
}
.tnpsc-sm-paywall-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #fff);
}

.tnpsc-sm-paywall-gate {
    background: #fff;
    padding: 28px 24px 32px;
    text-align: center;
    border-top: 1px solid #f0f2f5;
}
.tnpsc-sm-paywall-icon {
    font-size: 36px;
    margin-bottom: 10px;
    line-height: 1;
}
.tnpsc-sm-paywall-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1c1e21;
}
.tnpsc-sm-paywall-body {
    font-size: 14px;
    color: #65676b;
    max-width: 420px;
    margin: 0 auto 20px;
    line-height: 1.55;
}
.tnpsc-sm-paywall-login-hint {
    font-size: 13px;
    color: #65676b;
    margin: -12px 0 14px;
}
.tnpsc-sm-paywall-login-hint a { color: #1877f2; }

.tnpsc-sm-paywall-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.tnpsc-sm-paywall-cta {
    font-size: 15px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #1c1e21 !important;
    box-shadow: 0 4px 14px rgba(247, 151, 30, 0.4);
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
    display: inline-block;
}
.tnpsc-sm-paywall-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 151, 30, 0.5);
}

.tnpsc-sm-paywall-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.tnpsc-sm-paywall-features li {
    font-size: 13px;
    color: #1c1e21;
}

/* Lock icon badge on archive/search cards */
.tnpsc-sm-premium-badge {
    display: inline-block;
    font-size: 11px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #7a4000;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

/* =============================================================================
   v0.9.0: Doubts / Q&A section
   ========================================================================== */

.tnpsc-sm-doubt-section {
    margin: 36px 0 24px;
    padding-top: 24px;
    border-top: 1px solid #e4e6eb;
}
.tnpsc-sm-doubt-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #1c1e21;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tnpsc-sm-doubt-count {
    background: #e7f3ff;
    color: #1877f2;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.tnpsc-sm-doubt-form {
    background: #f6f7f8;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.tnpsc-sm-doubt-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d8dde3;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    background: #fff;
}
.tnpsc-sm-doubt-textarea:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}
.tnpsc-sm-doubt-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.tnpsc-sm-doubt-char-count { font-size: 12px; color: #9ca0a6; }
.tnpsc-sm-doubt-form-msg {
    margin: 6px 0 0;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
}
.tnpsc-sm-doubt-form-msg.is-success { background: #e9f7e7; color: #2d8316; }
.tnpsc-sm-doubt-form-msg.is-error   { background: #fdeaea; color: #b00020; }

.tnpsc-sm-doubt-login-prompt {
    margin-bottom: 20px;
    text-align: center;
}

.tnpsc-sm-doubt-empty {
    color: #9ca0a6;
    font-size: 14px;
    padding: 16px;
    text-align: center;
    background: #f6f7f8;
    border-radius: 8px;
}

.tnpsc-sm-doubt-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tnpsc-sm-doubt-item {
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.tnpsc-sm-doubt-item.is-answered { border-left: 3px solid #2d8316; }
.tnpsc-sm-doubt-item.is-open     { border-left: 3px solid #e6900a; }

.tnpsc-sm-doubt-q {
    padding: 14px 16px;
}
.tnpsc-sm-doubt-badge { display: block; margin-bottom: 6px; }
.tnpsc-sm-badge-answered {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: #e9f7e7;
    color: #2d8316;
    padding: 2px 8px;
    border-radius: 10px;
}
.tnpsc-sm-badge-open {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 10px;
}
.tnpsc-sm-doubt-text {
    margin: 0 0 6px;
    font-size: 14px;
    color: #1c1e21;
    line-height: 1.5;
}
.tnpsc-sm-doubt-meta {
    font-size: 12px;
    color: #9ca0a6;
}

.tnpsc-sm-doubt-reply {
    padding: 12px 16px;
    background: #f6f7f8;
    border-top: 1px solid #e4e6eb;
}
.tnpsc-sm-doubt-reply.is-admin {
    background: #f0f7ff;
    border-top-color: #cce0f5;
}
.tnpsc-sm-doubt-reply-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.tnpsc-sm-doubt-reply-tag {
    font-size: 12px;
    font-weight: 700;
    color: #1877f2;
}
.tnpsc-sm-doubt-reply-body {
    font-size: 14px;
    color: #1c1e21;
    line-height: 1.55;
}

/* Admin doubts list */
.tnpsc-sm-doubt-admin-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.tnpsc-sm-doubt-admin-item {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 16px;
}
.tnpsc-sm-doubt-admin-item.status-pending { border-left: 3px solid #d63638; }
.tnpsc-sm-doubt-admin-item.status-open    { border-left: 3px solid #dba617; }
.tnpsc-sm-doubt-admin-item.status-answered { border-left: 3px solid #00a32a; }
.tnpsc-sm-doubt-admin-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.tnpsc-sm-doubt-admin-topic { font-weight: 600; flex: 1; }
.tnpsc-sm-doubt-admin-topic a { color: #1d2327; text-decoration: none; }
.tnpsc-sm-doubt-admin-topic a:hover { color: #2271b1; }
.tnpsc-sm-doubt-admin-by { color: #50575e; font-size: 12px; }
.tnpsc-sm-doubt-admin-text {
    font-size: 14px;
    color: #1d2327;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f6f7f7;
    border-radius: 6px;
    line-height: 1.5;
}
.tnpsc-sm-doubt-admin-reply {
    margin: 8px 0;
    padding: 10px 12px;
    background: #e7f0fb;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.tnpsc-sm-doubt-reply-form textarea { margin-top: 8px; }
.tnpsc-sm-status-select { padding: 4px 6px; font-size: 13px; }

/* =============================================================================
   v1.0.0: Personalized Learning Dashboard
   ========================================================================== */

.tnpsc-sm-dashboard { max-width: 1100px; margin: 32px auto 64px; padding: 0 16px; }

/* Rank badge */
.tnpsc-sm-rank-badge {
    text-align: center;
    background: linear-gradient(135deg, #1877f2, #0858d4);
    color: #fff;
    border-radius: 14px;
    padding: 16px 22px;
    min-width: 120px;
    flex-shrink: 0;
}
.tnpsc-sm-rank-pct  { font-size: 22px; font-weight: 800; line-height: 1; }
.tnpsc-sm-rank-label { font-size: 11px; opacity: 0.8; margin: 2px 0; }
.tnpsc-sm-rank-sub  { font-size: 12px; opacity: 0.7; }

/* Trend arrows */
.tnpsc-sm-trend { font-size: 12px; font-weight: 600; margin-left: 4px; }
.tnpsc-sm-trend.up   { color: #2d8316; }
.tnpsc-sm-trend.down { color: #d32f2f; }

/* Summary cards */
.tnpsc-sm-dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0 24px;
}
.tnpsc-sm-dash-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 16px 18px;
    text-align: center;
}
.tnpsc-sm-dash-card--alert { border-color: #f5b8b8; background: #fff8f8; }
.tnpsc-sm-dash-card-num {
    font-size: 26px;
    font-weight: 700;
    color: #1c1e21;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.1;
}
.tnpsc-sm-dash-card-label { font-size: 11px; color: #65676b; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Dashboard grid */
.tnpsc-sm-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 768px) { .tnpsc-sm-dash-grid { grid-template-columns: 1fr; } }

.tnpsc-sm-dash-section {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 14px;
    padding: 20px;
}
.tnpsc-sm-chart-section { grid-column: span 1; }
.tnpsc-sm-plan-section { grid-column: span 2; }
@media (max-width: 768px) {
    .tnpsc-sm-plan-section { grid-column: span 1; }
}
.tnpsc-sm-dash-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1c1e21;
}
.tnpsc-sm-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.tnpsc-sm-section-head h2 { margin: 0; }
.tnpsc-sm-plan-prog {
    font-size: 12px;
    font-weight: 600;
    background: #e7f3ff;
    color: #1877f2;
    padding: 3px 10px;
    border-radius: 12px;
}

/* Today's plan list */
.tnpsc-sm-plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tnpsc-sm-plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f6f7f8;
    border-radius: 10px;
    border-left: 3px solid #1877f2;
    transition: all 0.15s;
}
.tnpsc-sm-plan-item.is-done { opacity: 0.55; border-left-color: #2d8316; }
.tnpsc-sm-plan-item-body { flex: 1; min-width: 0; }
.tnpsc-sm-plan-reason { display: block; font-size: 11px; color: #65676b; margin-bottom: 3px; }
.tnpsc-sm-plan-title { display: block; font-size: 14px; font-weight: 600; color: #1c1e21; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnpsc-sm-plan-title:hover { color: #1877f2; }
.tnpsc-sm-plan-code { font-size: 11px; color: #9ca0a6; font-family: monospace; }
.tnpsc-sm-plan-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tnpsc-sm-plan-btn-read,
.tnpsc-sm-plan-btn-practice {
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.tnpsc-sm-plan-btn-read     { background: #e7f3ff; color: #1877f2; }
.tnpsc-sm-plan-btn-practice { background: #e9f7e7; color: #2d8316; }
.tnpsc-sm-plan-btn-read:hover     { background: #1877f2; color: #fff; }
.tnpsc-sm-plan-btn-practice:hover { background: #2d8316; color: #fff; }
.tnpsc-sm-plan-btn-done-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid #d8dde3;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.tnpsc-sm-plan-btn-done-btn:hover { border-color: #2d8316; background: #e9f7e7; color: #2d8316; }
.tnpsc-sm-plan-done-badge { font-size: 13px; color: #2d8316; font-weight: 700; }

/* Plan setup form */
.tnpsc-sm-plan-setup-cta { text-align: center; padding: 20px; background: #f6f7f8; border-radius: 10px; }
.tnpsc-sm-plan-setup { margin-top: 16px; padding: 16px; background: #f6f7f8; border-radius: 10px; }
.tnpsc-sm-plan-setup h3 { font-size: 14px; margin: 0 0 12px; }
.tnpsc-sm-plan-setup-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.tnpsc-sm-plan-setup-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #65676b; }
.tnpsc-sm-plan-setup-fields input,
.tnpsc-sm-plan-setup-fields select { padding: 8px 10px; border: 1.5px solid #d8dde3; border-radius: 8px; font-size: 14px; background: #fff; }
.tnpsc-sm-plan-msg { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-top: 8px; }
.tnpsc-sm-plan-msg.is-success { background: #e9f7e7; color: #2d8316; }
.tnpsc-sm-plan-msg.is-error   { background: #fdeaea; color: #b00020; }

/* Charts */
.tnpsc-sm-chart-section canvas { max-height: 220px; }

/* Due reviews */
.tnpsc-sm-review-list { list-style: none; padding: 0; margin: 0; }
.tnpsc-sm-review-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
}
.tnpsc-sm-review-list li:last-child { border-bottom: none; }

/* Weak topics */
.tnpsc-sm-weak-list { list-style: none; padding: 0; margin: 0; }
.tnpsc-sm-weak-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}
.tnpsc-sm-weak-list li:last-child { border-bottom: none; }
.tnpsc-sm-weak-list a { font-size: 13px; font-weight: 600; color: #1c1e21; text-decoration: none; }
.tnpsc-sm-weak-list a:hover { color: #1877f2; }
.tnpsc-sm-weak-meta { display: block; font-size: 11px; color: #9ca0a6; margin-top: 2px; }
.tnpsc-sm-weak-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tnpsc-sm-score-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.tnpsc-sm-btn-sm { padding: 5px 12px !important; font-size: 12px !important; }

/* Time analysis bars */
.tnpsc-sm-time-bars { display: flex; flex-direction: column; gap: 10px; }
.tnpsc-sm-time-row { display: flex; align-items: center; gap: 10px; }
.tnpsc-sm-time-row > span:first-child { font-size: 12px; color: #65676b; width: 80px; flex-shrink: 0; }
.tnpsc-sm-time-bar-track { flex: 1; background: #f0f2f5; border-radius: 6px; height: 10px; overflow: hidden; }
.tnpsc-sm-time-bar { height: 100%; border-radius: 6px; transition: width 0.5s; }
.tnpsc-sm-time-bar.you  { background: linear-gradient(90deg, #1877f2, #42b0ff); }
.tnpsc-sm-time-bar.top  { background: linear-gradient(90deg, #2d8316, #42c72a); }
.tnpsc-sm-time-val { font-size: 12px; font-weight: 600; color: #1c1e21; width: 30px; text-align: right; }

/* Score badges */
.tnpsc-sm-score-strong     { background: #e9f7e7; color: #2d8316; }
.tnpsc-sm-score-fair       { background: #fff3cd; color: #856404; }
.tnpsc-sm-score-weak,
.tnpsc-sm-score-needs-work { background: #fdeaea; color: #b00020; }

/* Today's plan widget on /study/ index */
.tnpsc-sm-history-card-done {
    border-left-color: #2d8316 !important;
    opacity: 0.6;
}

/* =============================================================================
   v1.0.1: Empty-state onboarding for new users
   ========================================================================== */

.tnpsc-sm-empty-onboarding {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #cce0f5;
    border-radius: 16px;
    padding: 36px 32px;
    text-align: center;
    margin-bottom: 24px;
}
.tnpsc-sm-empty-onboarding-icon { font-size: 48px; margin-bottom: 12px; line-height: 1; }
.tnpsc-sm-empty-onboarding h2 { font-size: 22px; font-weight: 700; margin: 0 0 10px; color: #1c1e21; }
.tnpsc-sm-empty-onboarding p  { color: #65676b; max-width: 520px; margin: 0 auto 16px; font-size: 14px; line-height: 1.6; }
.tnpsc-sm-empty-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.tnpsc-sm-empty-features li { font-size: 13px; color: #1c1e21; }
.tnpsc-sm-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tnpsc-sm-empty-cta { font-size: 15px; padding: 12px 24px; }

/* =============================================================================
   v1.0.2: Quick Jump — fix overflow + 2-button layout + status indicators
   ========================================================================== */

/* Fix dropdown overflow — long Tamil topic names were getting clipped */
.tnpsc-sm-quick-jump-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
}
@media (max-width: 640px) {
    .tnpsc-sm-quick-jump-controls { grid-template-columns: 1fr; }
}
.tnpsc-sm-quick-jump-controls select {
    width: 100%;
    min-width: 0;             /* allow shrinking inside grid */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* New: action buttons row below the dropdowns */
.tnpsc-sm-quick-jump-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.tnpsc-sm-quick-action-btn {
    flex: 1;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid #d8dde3;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    color: #1c1e21;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.tnpsc-sm-quick-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
.tnpsc-sm-quick-action-btn:disabled {
    background: #f0f2f5;
    color: #9ca0a6;
    cursor: not-allowed;
    border-color: #e4e6eb;
}

/* Read button — blue gradient */
.tnpsc-sm-quick-read-btn:not(:disabled) {
    background: linear-gradient(135deg, #1877f2 0%, #0858d4 100%);
    color: #fff;
    border-color: #1877f2;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.2);
}
.tnpsc-sm-quick-read-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #2480ff 0%, #1069e8 100%);
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.35);
}

/* Practice button — green gradient */
.tnpsc-sm-quick-practice-btn:not(:disabled) {
    background: linear-gradient(135deg, #2d8316 0%, #1e6010 100%);
    color: #fff;
    border-color: #2d8316;
    box-shadow: 0 2px 8px rgba(45, 131, 22, 0.2);
}
.tnpsc-sm-quick-practice-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #36a01b 0%, #267013 100%);
    box-shadow: 0 4px 14px rgba(45, 131, 22, 0.35);
}
.tnpsc-sm-quick-practice-count {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
}

/* Hint text below buttons (shown when practice not available) */
.tnpsc-sm-quick-hint {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
}
@media (max-width: 480px) {
    .tnpsc-sm-quick-jump-actions { flex-direction: column; }
}
