/* ---------- tokens ---------- */
:root {
  --primary: #0067DD;
  --primary-soft: color-mix(in srgb, var(--primary) 10%, white);
  --primary-strong: color-mix(in srgb, var(--primary) 82%, black);
  --text: #1b2330;
  --muted: #5d6878;
  --border: #e3e7ee;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --danger: #c62f2f;
  --success: #1c7c4a;
  --warning: #9a6200;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; overflow-wrap: break-word; }  /* long names like cibil_loan_recommendation */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
code, pre, kbd { font-family: var(--mono); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 800px; }
.section { padding-top: 32px; padding-bottom: 32px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.right { text-align: right; }
.push-right { margin-left: auto; }
.pre-wrap { white-space: pre-wrap; }
.hp { position: absolute; left: -9999px; }

/* ---------- buttons, forms, notices ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--primary-strong); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: #fff; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, white); }
.btn-danger:hover { background: #fdf0f0; }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike.danger, .danger { color: var(--danger); }

.form label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: 16px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=search], .form select, .form textarea,
.filters input, .filters select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--text);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 5px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

.notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.notice-success { background: #edf8f1; border-color: #bfe5cf; color: var(--success); }
.notice-error { background: #fdf0f0; border-color: #f2c4c4; color: var(--danger); }
.notice-warning { background: #fff8e8; border-color: #f1dca6; color: var(--warning); }

/* ---------- header / footer ---------- */
.preview-banner { background: #fff3cd; color: #6b4e00; text-align: center; padding: 8px; font-size: .9rem; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; }
.header-search { flex: 1; max-width: 460px; }
.header-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; font-size: .95rem; }
.header-nav a:not(.btn) { color: var(--text); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 48px; padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px 24px; padding-bottom: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.footer-column h2 { margin: 0 0 10px; font-size: .9rem; font-weight: 600; color: var(--text); }
.footer-column ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-column a { color: var(--muted); font-size: .875rem; }
.footer-column a:hover, .footer-links a:hover { color: var(--primary); }

/* ---------- search ---------- */
.search-box { position: relative; }
.search-box input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--bg-soft); color: var(--text); }
.search-box input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); background: #fff; border-color: var(--primary); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box-big input { padding: 16px 20px 16px 50px; font-size: 1.1rem; background: #fff; box-shadow: var(--shadow-lg); border-color: transparent; }
.search-box-big .search-icon { left: 18px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; text-align: left; max-height: 70vh; overflow-y: auto; }
.search-results a { display: block; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--primary-soft); text-decoration: none; }
.search-results .sr-title { font-weight: 600; display: block; }
.search-results .sr-meta { font-size: .8rem; color: var(--muted); }
.search-results .sr-snippet { font-size: .85rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-all { font-weight: 600; color: var(--primary); background: var(--bg-soft); }
mark { background: color-mix(in srgb, var(--primary) 18%, white); color: inherit; border-radius: 2px; padding: 0 1px; }

.top-answer { border: 1px solid color-mix(in srgb, var(--primary) 30%, white); background: var(--primary-soft); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; }
.top-answer-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); font-weight: 700; margin-bottom: 4px; }
.top-answer-title { font-size: 1.15rem; font-weight: 600; display: block; margin-bottom: 6px; }
.top-answer p { margin: 0 0 8px; color: var(--text); }
.search-page-results { list-style: none; padding: 0; margin: 0; }
.search-page-results li { padding: 18px 0; border-bottom: 1px solid var(--border); }
.search-page-results li > a { font-size: 1.1rem; font-weight: 600; }
.search-page-results p { margin: 6px 0 0; color: var(--muted); }

/* ---------- home ---------- */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%); color: #fff; padding: 64px 0 72px; }
.hero-inner { max-width: 760px; text-align: center; }
.hero h1 { font-size: 2.6rem; margin-bottom: 8px; }
.hero p { opacity: .9; font-size: 1.1rem; margin: 0 0 28px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: -60px; }
.category-card { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, white); text-decoration: none; }
.category-card h2 { font-size: 1.1rem; margin: 2px 0 4px; }
.category-card p { margin: 0 0 6px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.cat-icon { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 1.4rem; font-weight: 700; overflow: hidden; }
.cat-icon img { width: 28px; height: 28px; object-fit: contain; }
.cat-icon.sm { width: 28px; height: 28px; font-size: .95rem; border-radius: 7px; }
.cat-icon.sm img { width: 18px; height: 18px; }
.cat-icon.lg { width: 60px; height: 60px; font-size: 1.9rem; border-radius: 14px; }
.cat-icon.lg img { width: 38px; height: 38px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.section-title { font-size: 1.2rem; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }
.article-list li:last-child { border-bottom: 0; }
.article-list-2col { columns: 2; column-gap: 40px; }
.article-list-2col li { break-inside: avoid; }
.article-list-cards li { display: block; padding: 0; border: 0; margin-bottom: 10px; }
.article-list-cards a { display: block; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.article-list-cards a:hover { border-color: var(--primary); text-decoration: none; }
.article-list-cards .muted { display: block; font-size: .9rem; margin-top: 2px; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--border); }
.cta h2 { font-size: 1.25rem; margin-bottom: 4px; }
.cta p { margin: 0; color: var(--muted); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; }

/* ---------- category ---------- */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--border); padding: 28px 0; }
.page-head-compact { padding: 14px 0; }
.page-title-row { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.page-title-row > div { min-width: 0; }
.page-title-row h1 { margin: 0; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 4px 0 0; }
.breadcrumbs { font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { opacity: .5; }
.subcategory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; margin-top: 24px; }
.subcategory { border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.subcategory-head { display: flex; align-items: center; gap: 10px; color: var(--text); margin-bottom: 8px; }
.subcategory-head h2 { font-size: 1.1rem; margin: 0; }
.see-all { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; }

/* ---------- article ---------- */
.article-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 40px; padding-top: 28px; }
.article-sidebar, .article-toc { position: sticky; top: 90px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: .9rem; }
.sidebar-title { display: block; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--muted); line-height: 1.4; }
.sidebar-list a:hover { background: var(--bg-soft); text-decoration: none; color: var(--text); }
.sidebar-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toc { border-left: 2px solid var(--border); padding-left: 14px; }
.toc-title { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 6px 0; line-height: 1.35; }
.toc a { color: var(--muted); }
.toc a.active { color: var(--primary); font-weight: 600; }
.toc .toc-l3 { padding-left: 12px; font-size: .85rem; }
.article-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 24px; }
.article-header h1 { font-size: 2.1rem; }
.article-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.dot { opacity: .5; }

.prose { font-size: 1.02rem; line-height: 1.75; overflow-wrap: break-word; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 .6em; padding-top: .2em; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
.prose h4 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.prose p { margin: 0 0 1em; }
.prose img { border-radius: 8px; border: 1px solid var(--border); margin: 8px 0; display: block; }
/* Imported content carries fixed widths (width: 600px videos, width: 468pt tables): never wider than the column. */
.prose img, .prose video { max-width: 100%; height: auto; }
.prose figure { margin: 1.2em 0; max-width: 100%; height: auto !important; }  /* some editor tables saved height: 10px and spilled over the page */
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose li > p { margin: 0; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--primary); background: var(--bg-soft); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose code { background: var(--bg-soft); border: 1px solid var(--border); padding: .1em .35em; border-radius: 5px; font-size: .88em; }
.prose pre { background: #0f1720; color: #e6edf3; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: .88rem; line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose pre code.hljs { background: transparent; color: #e6edf3; padding: 0; }
.code-block { position: relative; }
.code-block pre { padding-top: 40px; }
.code-copy { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(230, 237, 243, .25); background: rgba(230, 237, 243, .08); color: #e6edf3; font: 600 .78rem var(--font); cursor: pointer; }
.code-copy:hover { background: rgba(230, 237, 243, .18); }
.code-copy:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.prose table { width: 100%; max-width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th, .prose thead td { background: var(--bg-soft); font-weight: 600; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; margin: 8px 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose details { border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; margin: 1em 0; }
.prose summary { cursor: pointer; font-weight: 600; }

/* Callouts (inserted with the editor's "Callout" button) */
.prose .callout { border-radius: 10px; padding: 14px 18px 14px 46px; margin: 1.2em 0; position: relative; border: 1px solid; }
.prose .callout > :last-child { margin-bottom: 0; }
.prose .callout::before { position: absolute; left: 16px; top: 13px; font-size: 1.05rem; }
.prose .callout-title { font-weight: 600; }
.prose .callout-info { background: #eef5ff; border-color: #c9defc; }
.prose .callout-info::before { content: "ℹ️"; }
.prose .callout-tip { background: #edf8f1; border-color: #bfe5cf; }
.prose .callout-tip::before { content: "💡"; }
.prose .callout-warning { background: #fff8e8; border-color: #f1dca6; }
.prose .callout-warning::before { content: "⚠️"; }
.prose .callout-danger { background: #fdf0f0; border-color: #f2c4c4; }
.prose .callout-danger::before { content: "⛔"; }

.feedback { margin-top: 40px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); }
.feedback-question { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.feedback-buttons { display: flex; gap: 12px; }  /* Yes and No wrap together, never apart */
.feedback-comment label { display: block; margin-bottom: 8px; font-weight: 500; }
.feedback-comment textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; margin-bottom: 10px; }
.feedback-thanks { margin: 0; }
.support-note { margin: 20px 0 0; font-size: .95rem; }
.related { margin-top: 36px; }
.related h2 { font-size: 1.2rem; }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--primary-soft), var(--bg-soft)); padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 36px; }
.auth-brand { margin-bottom: 24px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-links { text-align: center; margin-top: 18px; font-size: .92rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .article-toc { display: none; }
}
@media (max-width: 820px) {
  .header-inner { gap: 12px; }
  .header-search { display: none; }
  .nav-toggle { display: block; }
  .header-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; padding: 16px 24px; gap: 14px; }
  .header-nav.open { display: flex; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-sidebar { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .article-list-2col { columns: 1; }
  .hero h1 { font-size: 2rem; }
  .category-grid, .subcategory-grid { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
  .container { padding: 0 16px; }
}
@media (max-width: 480px) {
  .footer-links { flex-direction: column; gap: 10px; }  /* one link per line rather than one left over */
}
