:root {
    --primary: #1a6eb5;
    --primary-dark: #155a96;
    --teal: #1d9e9a;
    --teal-dark: #178481;
    --navy: #1e2d40;
    --text: #2d3748;
    --text-muted: #64748b;
    --light-bg: #f0f6ff;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --badge-pub: #1d9e9a;
    --badge-edu: #7c3aed;
    --badge-qa: #d97706;
    --reviewed-bg: #dcfce7;
    --reviewed-text: #166534;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.7;
}

/* ── Navbar ── */
.navbar-brand .brand-at { color: var(--teal); }
.navbar-brand .brand-med { color: var(--primary); }
.navbar-brand .brand-stu { color: var(--navy); }
.navbar-brand .brand-tagline {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}
.navbar { box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.nav-link { font-size: 0.9rem; font-weight: 500; color: var(--navy) !important; }
.nav-link:hover, .nav-link.active { color: var(--primary) !important; }
.navbar-nav .nav-item.highlight .nav-link {
    background: var(--primary);
    color: #fff !important;
    border-radius: 6px;
    padding: 0.35rem 1rem;
}
.navbar-nav .nav-item.highlight .nav-link:hover { background: var(--primary-dark); }

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, #1e2d40 0%, #1a6eb5 60%, #1d9e9a 100%);
    color: #fff;
    padding: 90px 0 70px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .badge-pill {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 0.78rem;
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; }
.hero p.lead { font-size: 1.05rem; opacity: 0.9; max-width: 600px; }
.hero .btn-hero-primary {
    background: #fff;
    color: var(--primary);
    border: none;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: all 0.2s;
}
.hero .btn-hero-primary:hover { background: var(--light-bg); transform: translateY(-1px); }
.hero .btn-hero-outline {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.5);
    font-weight: 500;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: all 0.2s;
}
.hero .btn-hero-outline:hover { border-color: #fff; background: rgba(255,255,255,0.1); }

/* ── Section headings ── */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.4rem;
}
.section-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}
.section-subtitle { color: var(--text-muted); font-size: 0.97rem; max-width: 560px; }

/* ── Pillar cards ── */
.pillar-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    background: var(--card-bg);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.pillar-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
}
.pillar-card.pub::before { background: var(--teal); }
.pillar-card.edu::before { background: #7c3aed; }
.pillar-card.qa::before  { background: #d97706; }
.pillar-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); }
.pillar-icon {
    width: 54px; height: 54px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
}
.pillar-icon.pub { background: #e6f7f7; color: var(--teal); }
.pillar-icon.edu { background: #ede9fe; color: #7c3aed; }
.pillar-icon.qa  { background: #fef3c7; color: #d97706; }
.pillar-card h4 { font-weight: 700; color: var(--navy); font-size: 1.15rem; }
.pillar-card p  { color: var(--text-muted); font-size: 0.93rem; }
.btn-pillar {
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 7px;
    padding: 0.5rem 1.1rem;
    border: 1.5px solid;
    transition: all 0.2s;
}
.btn-pillar.pub { color: var(--teal); border-color: var(--teal); }
.btn-pillar.pub:hover { background: var(--teal); color: #fff; }
.btn-pillar.edu { color: #7c3aed; border-color: #7c3aed; }
.btn-pillar.edu:hover { background: #7c3aed; color: #fff; }
.btn-pillar.qa  { color: #d97706; border-color: #d97706; }
.btn-pillar.qa:hover  { background: #d97706; color: #fff; }

/* ── Article / Content cards ── */
.content-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.4rem;
    background: #fff;
    height: 100%;
    transition: box-shadow 0.2s;
}
.content-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.content-card .cat-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.75rem;
}
.cat-badge.pub    { background: #e6f7f7; color: var(--teal-dark); }
.cat-badge.edu    { background: #ede9fe; color: #6d28d9; }
.cat-badge.qa     { background: #fef3c7; color: #92400e; }
.cat-badge.mcq    { background: #dbeafe; color: #1d4ed8; }
.cat-badge.osce   { background: #fce7f3; color: #9d174d; }
.content-card h5 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.4rem; line-height: 1.35; }
.article-title-link {
    color: inherit;
    text-decoration: none;
}
.article-title-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
.content-card p  { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.reviewed-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--reviewed-bg);
    color: var(--reviewed-text);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}
.card-meta { font-size: 0.78rem; color: var(--text-muted); }
.card-meta span { margin-right: 0.6rem; }
.btn-read-more {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
}
.btn-read-more:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── Why section ── */
.why-section { background: var(--light-bg); }
.why-item { text-align: center; padding: 1.5rem 1rem; }
.why-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 1rem;
}
.why-item h6 { font-weight: 700; color: var(--navy); }
.why-item p  { font-size: 0.88rem; color: var(--text-muted); }

/* ── Submit CTA ── */
.submit-cta {
    background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
}
.submit-cta h3 { font-weight: 800; }
.submit-cta p  { opacity: 0.85; max-width: 520px; margin: 0 auto 1.5rem; }

/* ── Page header ── */
.page-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 60px 0 50px;
}
.page-header h1 { font-weight: 800; font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.page-header p  { opacity: 0.85; font-size: 1rem; max-width: 580px; }
.breadcrumb-item a { color: rgba(255,255,255,0.7); text-decoration: none; }
.breadcrumb-item a:hover { color: #fff; }
.breadcrumb-item.active { color: rgba(255,255,255,0.9); }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.4); }

/* ── Filters / Sidebar ── */
.filter-bar {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.filter-bar .form-select, .filter-bar .form-control {
    font-size: 0.9rem;
    border-radius: 8px;
}
.category-pill {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.category-pill:hover, .category-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Forms ── */
.form-section { background: var(--light-bg); border-radius: 12px; padding: 2rem; }
.form-label { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 0.92rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,110,181,0.12);
}
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.btn-primary-custom:hover { background: var(--primary-dark); }

/* ── Policy pages ── */
.policy-content h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-top: 2rem; }
.policy-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-top: 1.5rem; }
.policy-content p, .policy-content li { font-size: 0.95rem; color: var(--text); }
.policy-content ul { padding-left: 1.4rem; }
.policy-content li { margin-bottom: 0.4rem; }
.important-box {
    background: #fff3cd;
    border-left: 4px solid #d97706;
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

/* ── Footer ── */
footer {
    background: var(--navy);
    color: rgba(255,255,255,0.8);
}
footer .brand-footer { font-size: 1.3rem; font-weight: 800; }
footer .brand-footer .at { color: var(--teal); }
footer .brand-footer .med { color: #7eb8e8; }
footer .brand-footer .stu { color: #fff; }
footer h6 { color: #fff; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
footer a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.88rem; display: block; margin-bottom: 0.4rem; transition: color 0.15s; }
footer a:hover { color: var(--teal); }
footer .footer-divider { border-color: rgba(255,255,255,0.1); }
footer .footer-bottom { font-size: 0.82rem; color: rgba(255,255,255,0.45); }
footer .footer-bottom a { display: inline; color: rgba(255,255,255,0.55); margin: 0 0.5rem; }

/* ── Tools / Calculators pillar (green) ── */
.pillar-card.tools::before { background: #16a34a; }
.pillar-icon.tools { background: #dcfce7; color: #16a34a; }
.btn-pillar.tools { color: #16a34a; border-color: #16a34a; }
.btn-pillar.tools:hover { background: #16a34a; color: #fff; }
.cat-badge.tools { background: #dcfce7; color: #15803d; }

/* ── Calculator pages ── */
.tool-hero {
    background: linear-gradient(135deg, #1e2d40 0%, #15803d 100%);
    color: #fff;
    padding: 60px 0 50px;
}
.tool-hero h1 { font-weight: 800; font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.tool-hero p  { opacity: 0.85; font-size: 1rem; max-width: 620px; }
.tool-hero .breadcrumb-item a { color: rgba(255,255,255,0.7); text-decoration: none; }
.tool-hero .breadcrumb-item a:hover { color: #fff; }
.tool-hero .breadcrumb-item.active { color: rgba(255,255,255,0.9); }
.tool-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.4); }

.tool-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.result-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #16a34a;
    border-radius: 12px;
    padding: 1.5rem;
    display: none;
}
.result-card.show { display: block; }
.result-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #16a34a;
    line-height: 1;
}
.result-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.result-interp { font-size: 0.95rem; font-weight: 600; }
.result-interp.interp-low  { color: #dc2626; }
.result-interp.interp-normal { color: #16a34a; }
.result-interp.interp-high { color: #d97706; }

.formula-box {
    background: #1e2d40;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}
.formula-box .formula-var { color: #7dd3fc; }
.formula-box .formula-comment { color: rgba(255,255,255,0.4); font-style: italic; }

.interpretation-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
}
.interpretation-box h6 { font-weight: 700; color: var(--navy); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.interp-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.interp-row:last-child { border-bottom: none; }

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #d97706;
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--text);
}
.info-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--text);
}
.example-box {
    background: #f0f6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1.5rem;
    font-size: 0.92rem;
}
.example-box h6 { font-weight: 700; color: var(--navy); margin-bottom: 0.75rem; }
.example-step { padding: 0.3rem 0; font-size: 0.9rem; color: var(--text); }
.example-step strong { color: var(--navy); }

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.related-tool-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--navy);
    display: block;
    transition: all 0.2s;
    background: #fff;
}
.related-tool-card:hover {
    border-color: #16a34a;
    background: #f0fdf4;
    color: var(--navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(22,163,74,0.12);
}
.related-tool-card .rtc-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: #dcfce7;
    color: #16a34a;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}
.related-tool-card h6 { font-weight: 700; font-size: 0.93rem; margin-bottom: 0.3rem; }
.related-tool-card p  { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

.calc-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
    cursor: pointer;
}
.calc-btn:hover { background: #15803d; }
.calc-btn-reset {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
}
.calc-btn-reset:hover { border-color: var(--text-muted); color: var(--text); }
.calc-error { color: #dc2626; font-size: 0.83rem; display: none; margin-top: 0.35rem; }
.calc-error.show { display: block; }

.disclaimer-calc {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Featured article ── */
.featured-article-section { background: #ffffff; }
.featured-article-card {
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}
.featured-article-img { width: 100%; object-fit: cover; max-height: 320px; }

/* ── Stats strip ── */
.stats-strip { background: #f8fafc; }
.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.1rem 0.8rem;
  height: 100%;
}
.stat-number { font-size: 1.45rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label  { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ── Specialty cards ── */
.specialty-card {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 1.2rem 0.8rem;
  display: block;
  height: 100%;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.specialty-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  border-color: var(--primary);
}
.specialty-icon {
  width: 46px; height: 46px;
  margin: 0 auto 0.7rem;
  border-radius: 14px;
  background: var(--light-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
}
.specialty-name { color: var(--navy); font-weight: 700; font-size: 0.9rem; }

/* ── Utilities ── */
.bg-light-blue { background: var(--light-bg); }
.text-primary-custom { color: var(--primary) !important; }
.text-teal { color: var(--teal) !important; }
.text-navy { color: var(--navy) !important; }

/* ── Q card ── */
.question-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.4rem;
    background: #fff;
    height: 100%;
    transition: box-shadow 0.2s;
}
.question-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.diff-badge {
    font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 4px;
}
.diff-easy   { background: #dcfce7; color: #166534; }
.diff-medium { background: #fef3c7; color: #92400e; }
.diff-hard   { background: #fee2e2; color: #991b1b; }

/* article-index list */
.article-index-list .list-group-item {
    border-color: var(--border);
    font-size: 0.93rem;
}
.article-index-list .list-group-item:hover {
    background: var(--light-bg);
}

/* ── Responsive tables (article pages) ── */
.art-tbl {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
    /* Article sidebar stacks below on mobile — give it breathing room */
    .sdb-card { margin-bottom: 1rem; }
}

@media (max-width: 768px) {
    /* Hero */
    .hero { padding: 55px 0 45px; }
    .hero h1 { font-size: 1.75rem; }
    .hero p.lead { font-size: 0.96rem; }

    /* Pillar cards */
    .pillar-card { margin-bottom: 1rem; }

    /* Sections */
    .page-header { padding: 40px 0 32px; }
    .tool-hero   { padding: 40px 0 32px; }

    /* Submit CTA */
    .submit-cta { padding: 2rem 1.25rem; }
    .submit-cta p { font-size: 0.9rem; }

    /* Why section */
    .why-item { padding: 1.1rem 0.75rem; }

    /* Tool cards */
    .tool-card { padding: 1.25rem; }
    .input-grid { grid-template-columns: 1fr; }
    .result-value { font-size: 2rem; }

    /* Article body */
    .art-sec h2 { font-size: 1.15rem; }
    .art-sec p, .art-sec ul, .art-sec ol { font-size: 0.93rem; }
    .art-tbl th, .art-tbl td { font-size: 0.82rem; padding: 0.4rem 0.65rem; }

    /* Related tools grid */
    .related-tools-grid { grid-template-columns: 1fr; }

    /* Filter bar */
    .filter-bar { padding: 1rem; }
}

@media (max-width: 576px) {
    /* Hero */
    .hero { padding: 42px 0 36px; }
    .hero h1 { font-size: 1.55rem; }

    /* Section headings */
    .section-title { font-size: 1.3rem; }

    /* Submit CTA */
    .submit-cta h3 { font-size: 1.35rem; }
    .submit-cta { padding: 1.6rem 1rem; }

    /* Footer brand */
    footer .brand-footer { font-size: 1.1rem; }

    /* Pillar card icon */
    .pillar-icon { width: 46px; height: 46px; font-size: 1.2rem; }

    /* Article hero meta */
    .art-meta-row { gap: 0.5rem 1rem; font-size: 0.78rem; }
}
