:root {
    --bg-primary: #0f1419;
    --bg-secondary: #192734;
    --bg-card: #22303c;
    --text-primary: #f7f9f9;
    --text-secondary: #8899a6;
    --accent: #1da1f2;
    --accent-hover: #1a91da;
    --success: #17bf63;
    --warning: #ffad1f;
    --error: #e0245e;
    --border: #38444d;
    --shadow: rgba(0, 0, 0, 0.3);
}

:root.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f8fa;
    --bg-card: #ffffff;
    --text-primary: #14171a;
    --text-secondary: #657786;
    --accent: #1da1f2;
    --accent-hover: #1a91da;
    --border: #e1e8ed;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--accent);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.theme-btn, .mobile-menu-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

.mobile-menu-btn {
    display: none;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 200;
    transition: right 0.3s;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
}

.mobile-nav-links a:hover {
    background: var(--bg-card);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hero */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.search-box {
    max-width: 500px;
    margin: 0 auto 2rem;
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box button {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.search-box button:hover {
    background: var(--accent-hover);
}

/* Autocomplete dropdown attached to .search-box */
.search-box {
    position: relative;
}

.autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--shadow);
    max-height: 350px;
    overflow-y: auto;
    text-align: left;
}

.autocomplete[hidden] {
    display: none;
}

.autocomplete-option {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover,
.autocomplete-option.active {
    background: var(--bg-secondary);
}

.autocomplete-option .opt-type {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.autocomplete-option .opt-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Exam Boards */
.exam-boards {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.exam-boards h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.board-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.board-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.board-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.subject-count {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

/* Subjects */
.subjects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.subjects h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.category-tab {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab:hover {
    border-color: var(--accent);
}

.category-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.subject-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.subject-card h3 {
    margin-bottom: 0.5rem;
}

.subject-category {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.board-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.board-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.paper-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Search results (subjects grid) */
.search-section-header {
    grid-column: 1 / -1;
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.search-section-header:first-child {
    margin-top: 0;
}

.subject-card.topic-result {
    border-left: 3px solid var(--accent);
}

.topic-id-mini {
    display: inline-block;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--accent);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* About */
.about {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.about h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.about-text ul {
    list-style: none;
    margin-top: 1rem;
}

.about-text li {
    padding: 0.5rem 0;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.feature {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.feature h4 {
    margin-bottom: 0.25rem;
}

.feature p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Topic & Landing Page Styles */
.topic-content {
padding: 1.5rem 1rem 3rem;
padding-left: 240px;
padding-right: 310px;
min-height: 100vh;
}

.ad-right {
position: fixed;
top: 60px;
right: 0;
width: 300px;
height: calc(100vh - 60px);
overflow-y: auto;
overflow-x: hidden;
z-index: 10;
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0;
}

.ad-right .ad-unit {
min-height: 250px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg-card);
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
color: var(--text-secondary);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sidebar {
width: 220px;
position: fixed;
top: 60px;
left: 0;
height: calc(100vh - 60px);
overflow-y: auto;
background: var(--bg-secondary);
border-right: 1px solid var(--border);
padding: 0.75rem 0;
z-index: 50;
}

.sidebar h3 {
font-size: 0.8rem;
text-transform: uppercase;
color: var(--text-secondary);
padding: 0.5rem 0.75rem;
margin: 0;
letter-spacing: 0.05em;
}

.sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}

.sidebar li a {
display: block;
padding: 0.4rem 0.75rem;
color: var(--text-secondary);
text-decoration: none;
font-size: 0.85rem;
transition: all 0.15s;
border-left: 3px solid transparent;
}

.sidebar li a:hover {
color: var(--accent);
background: rgba(29, 161, 242, 0.08);
border-left-color: var(--accent);
}

.sidebar li a.active {
color: var(--accent);
font-weight: 600;
border-left-color: var(--accent);
background: rgba(29, 161, 242, 0.1);
}

.sidebar-toggle {
display: none;
position: fixed;
bottom: 1rem;
right: 1rem;
z-index: 200;
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--accent);
color: #fff;
border: none;
font-size: 1.3rem;
cursor: pointer;
box-shadow: 0 2px 8px var(--shadow);
}

.page-body {
max-width: 900px;
margin: 0 auto;
}

@media (max-width: 1280px) {
.ad-right {
display: none;
}
.topic-content {
padding-right: 1rem;
}
}

@media (max-width: 900px) {
.sidebar {
display: none;
width: 280px;
height: 100vh;
z-index: 150;
border-radius: 0;
}

.sidebar.open {
display: block;
}

.sidebar-toggle {
display: flex;
align-items: center;
justify-content: center;
}

.topic-content {
padding-left: 1rem;
padding-right: 1rem;
}
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

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

.breadcrumb span {
  margin: 0 0.25rem;
}

.topic-header {
  margin-bottom: 2rem;
}

.topic-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge.foundation {
  background: rgba(23, 191, 99, 0.15);
  color: var(--success);
  border-color: var(--success);
}

.badge.higher {
  background: rgba(29, 161, 242, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

.topic-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.section {
  margin-bottom: 2rem;
}

.section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
}

.section ul {
  margin: 0.5rem 0 1rem 1.5rem;
}

.section li {
  margin-bottom: 0.3rem;
}

.key-point {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 0 8px 8px 0;
}

.example {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.example-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.formula-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.comparison-table th,
.comparison-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.comparison-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comparison-table a {
  color: var(--accent);
  text-decoration: none;
}

.comparison-table a:hover {
  text-decoration: underline;
}

.practice-questions {
  margin: 1rem 0;
}

.question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.section ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.section ol li {
  margin-bottom: 0.4rem;
}

/* Topics Grid (Landing Pages) */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.topic-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--accent);
}

.topic-card.higher-only {
  border-left: 3px solid var(--accent);
}

.topic-id {
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-name {
  font-size: 0.9rem;
  line-height: 1.3;
}

.topic-card .badge.higher {
  flex-shrink: 0;
  margin-left: auto;
}

/* Topic Navigation */
.topic-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.topic-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
}

.topic-nav a:hover {
  text-decoration: underline;
}

/* Responsive Topic Pages */
@media (max-width: 768px) {
  .topic-header h1 {
    font-size: 1.5rem;
  }

  .section h2 {
    font-size: 1.2rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.site-footer p {
    margin: 0.5rem 0;
}

.site-footer a {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .quick-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
  .about-features {
    grid-template-columns: 1fr;
  }
}

.required-practical {
  background: #e3f2fd;
  border: 2px solid #1565c0;
  border-radius: 6px;
  padding: 18px;
  margin: 20px 0;
}

.required-practical h3 {
  color: #1565c0;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.maths-skill {
  background: #f3e5f5;
  border-left: 4px solid #7b1fa2;
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 4px;
}

.maths-skill h3 {
  color: #7b1fa2;
  margin-bottom: 8px;
  font-size: 1.05em;
}

.misconception {
  background: #fce4ec;
  border-left: 4px solid #c62828;
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 4px;
}

.misconception h3 {
  color: #c62828;
  margin-bottom: 8px;
  font-size: 1.05em;
}

.misconception .wrong {
  color: #c62828;
  text-decoration: line-through;
  font-weight: bold;
}

.misconception .right {
  color: #2e7d32;
  font-weight: bold;
}

.extended-question {
  background: #fff8e1;
  border: 2px solid #f57f17;
  padding: 18px;
  margin: 20px 0;
  border-radius: 6px;
}

.extended-question h3 {
  color: #f57f17;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.extended-question .model-answer {
  display: none;
  margin-top: 10px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 4px;
  border-left: 3px solid #2e7d32;
}

.extended-question.show-answer .model-answer {
  display: block;
}

.ao3-section {
  background: #e0f2f1;
  border-left: 4px solid #00695c;
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 4px;
}

.ao3-section h3 {
  color: #00695c;
  margin-bottom: 8px;
  font-size: 1.05em;
}

:root.light-mode .required-practical { background: #e3f2fd; }
:root.light-mode .maths-skill { background: #f3e5f5; }
:root.light-mode .misconception { background: #fce4ec; }
:root.light-mode .extended-question { background: #fff8e1; }
:root.light-mode .ao3-section { background: #e0f2f1; }

:root:not(.light-mode) .required-practical { background: #1a2940; border-color: #42a5f5; }
:root:not(.light-mode) .required-practical h3 { color: #42a5f5; }
:root:not(.light-mode) .maths-skill { background: #2a1a30; border-color: #ab47bc; }
:root:not(.light-mode) .maths-skill h3 { color: #ab47bc; }
:root:not(.light-mode) .misconception { background: #301a1e; border-color: #ef5350; }
:root:not(.light-mode) .misconception h3 { color: #ef5350; }
:root:not(.light-mode) .misconception .wrong { color: #ef5350; }
:root:not(.light-mode) .misconception .right { color: #66bb6a; }
:root:not(.light-mode) .extended-question { background: #2a2510; border-color: #ffb300; }
:root:not(.light-mode) .extended-question h3 { color: #ffb300; }
:root:not(.light-mode) .extended-question .model-answer { background: #1a2e1a; border-color: #66bb6a; }
:root:not(.light-mode) .ao3-section { background: #1a2a28; border-color: #26a69a; }
:root:not(.light-mode) .ao3-section h3 { color: #26a69a; }

.disclaimer-banner {
  background: var(--bg-card);
  border: 1px solid var(--warning);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.disclaimer-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.affiliate-section {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.affiliate-section h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}
.affiliate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}
.affiliate-card {
  display: block;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-left: 3px solid #FF9900;
  border-radius: 8px;
  padding: 0.8rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.affiliate-card:hover {
  border-color: #FF9900;
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
}
.affiliate-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.affiliate-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.affiliate-card-store {
  font-size: 0.75rem;
  color: #FF9900;
  margin-top: 0.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.affiliate-card-store img {
  height: 14px;
  width: auto;
  vertical-align: middle;
}
.affiliate-card-urgency {
  font-size: 0.65rem;
  color: #e0245e;
  margin-top: 0.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.affiliate-card[data-fastmail] .affiliate-card-icon {
  float: right;
  margin-left: 0.6rem;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  flex-shrink: 0;
}
 .fastmail-topbar {
   display: block;
   margin-bottom: 12px;
   text-decoration: none;
 }
 .fastmail-topbar[hidden] {
   display: none !important;
 }
  .fastmail-topbar img {
    display: block;
    width: 100%;
    max-width: 970px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    transition: box-shadow 0.2s, transform 0.15s;
  }
 .fastmail-topbar:hover img {
   box-shadow: 0 4px 16px rgba(139,92,246,0.35);
   transform: translateY(-1px);
 }
 .fastmail-topbar-icon {
   width: 20px;
   height: 20px;
   vertical-align: middle;
 }
 .fastmail-topbar-text {
   color: #e0e7ff;
   font-weight: 600;
 }
 .fastmail-topbar-cta {
   color: #a78bfa;
   font-size: 0.75rem;
 }
.fastmail-trademark {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  line-height: 1.3;
}
.ad-right .affiliate-card {
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-left: 3px solid #FF9900;
  border-radius: 8px;
  padding: 0.8rem;
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.ad-right .affiliate-card:hover {
  border-color: #FF9900;
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
  transform: translateY(-1px);
}
.ad-right .affiliate-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}
.ad-right .affiliate-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}
.ad-right .affiliate-card-store {
  font-size: 0.7rem;
  color: #FF9900;
  margin-top: 0.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.ad-right .affiliate-card-store img {
  height: 12px;
  width: auto;
  vertical-align: middle;
}
.ad-right .affiliate-card-urgency {
  font-size: 0.65rem;
  color: #e0245e;
  margin-top: 0.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.affiliate-disclaimer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.6rem;
  line-height: 1.4;
}
.affiliate-cta-end {
  margin: 2rem 0 1rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.affiliate-cta-end h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.affiliate-cta-end p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.affiliate-cta-end .cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.affiliate-cta-end .cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #FF9900, #e68a00);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}
.affiliate-cta-end .cta-link:hover {
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.4);
  transform: translateY(-1px);
}
.share-section {
  text-align: center;
}
.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.share-btn {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }
.share-twitter { background: #1DA1F2; }
.share-facebook { background: #1877F2; }
.share-linkedin { background: #0A66C2; }
.share-whatsapp { background: #25D366; color: #fff; }
.share-copy {
  background: var(--bg-card, #22303c);
  border: 1px solid var(--border, #38444d);
  cursor: pointer;
}
.related-topics .related-group {
  margin-bottom: 1rem;
}
.related-topics h4 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--text-secondary, #8899a6);
}
.related-topics ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.related-topics li a {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--bg-card, #22303c);
  border: 1px solid var(--border, #38444d);
  border-radius: 4px;
  color: var(--text-primary, #f7f9f9);
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}
.related-topics li a:hover {
  border-color: var(--primary, #4A90D9);
}
