/* ========================================================
   TechPortal - Mobile-First High-Performance Stylesheet
   Palette: Light Crimson / Creamy Aesthetic
   Target: Google PageSpeed 95+ (Zero bloat, pure CSS)
   ======================================================== */

:root {
  --bg-cream: #FAF7F2;
  --surface: #FFFFFF;
  --surface-alt: #F4EFEB;
  --accent-crimson: #C92A42;
  --accent-crimson-hover: #A61E33;
  --accent-crimson-subtle: #FDF2F4;
  --text-dark: #1E2229;
  --text-muted: #5A6270;
  --text-subtle: #8C96A6;
  --border-color: #E8E2D8;
  --star-gold: #F59E0B;
  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", Cambria, "Times New Roman", serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.03);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.05);
  --container-max: 1140px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-crimson);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.dashboard-container {
  padding: 2.5rem 1.25rem;
}

.form-page-container {
  max-width: 760px;
  padding: 2.5rem 1.25rem;
}

.auth-container {
  max-width: 460px;
  padding: 3.5rem 1.25rem;
}

.custom-page-container {
  max-width: 880px;
  padding: 2.5rem 1.25rem;
}

.editor-page-container {
  max-width: 980px;
  padding: 2rem 1.25rem;
}

.custom-page-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
}

.page-main-title {
  font-size: 2.2rem;
  font-weight: 850;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ---------------- Navbar ---------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-dark);
}

.brand-logo span {
  color: var(--accent-crimson);
}

.brand-dot {
  width: 9px;
  height: 9px;
  background: var(--accent-crimson);
  border-radius: 50%;
  display: inline-block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 6px 4px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-crimson);
}

.nav-highlight {
  color: var(--accent-crimson) !important;
}

.desktop-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-controls {
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-quick-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.mobile-toggle {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
  color: var(--text-dark);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.mobile-drawer-actions {
  display: none;
}

.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 22, 0.55);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-backdrop.open {
  display: block;
  opacity: 1;
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
  padding: 0.65rem 1rem;
}

/* Dashboard & Form Components */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

/* ---------------- Hero & Featured ---------------- */
.hero-banner {
  padding: 2rem 0 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111;
  aspect-ratio: 16/9;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  opacity: 0.88;
}

.hero-card:hover img {
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(15,18,22,0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: #FFF;
}

.hero-tag {
  background: var(--accent-crimson);
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  color: #FFF;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #CBD5E1;
  margin-top: 0.5rem;
}

/* ---------------- Section Headers ---------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2.25rem 0 1.25rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -0.6rem;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent-crimson);
}

/* ---------------- Post & Review Cards ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-alt);
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-crimson);
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.card-content {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
}

/* ---------------- Phone Review Cards ---------------- */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.review-card:hover {
  transform: translateY(-2px);
}

.review-card-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.review-device-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.review-model-info {
  flex-grow: 1;
}

.review-model-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
}

.review-variant {
  font-size: 0.75rem;
  color: var(--accent-crimson);
  font-weight: 600;
  margin-top: 2px;
}

.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--star-gold);
  font-size: 0.9rem;
}

.rating-num {
  font-size: 0.82rem;
  color: var(--text-dark);
  margin-left: 4px;
}

/* ---------------- Article Layout (Mobile-First SEO) ---------------- */
.article-wrapper {
  display: grid;
  grid-template-columns: 2.8fr 1.2fr;
  gap: 2rem;
  padding: 2rem 0;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
}

.article-breadcrumbs a {
  color: var(--text-muted);
}

.article-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

/* Dual Byline: Author & Fact-Checker */
.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.byline-person {
  display: flex;
  align-items: center;
  gap: 8px;
}

.byline-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface-alt);
}

.byline-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dark);
}

.byline-role {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 600;
}

.byline-badge {
  background: #E0F2FE;
  color: #0369A1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.article-featured-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.75rem;
  background: var(--surface-alt);
}

.article-featured-media img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Table of Contents */
.article-toc {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-crimson);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  margin: 1.5rem 0 2rem;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.toc-toggle {
  background: none;
  border: none;
  color: var(--accent-crimson);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.toc-list {
  list-style: none;
  font-size: 0.88rem;
}

.toc-item {
  margin-bottom: 0.4rem;
}

.toc-item a {
  color: var(--text-dark);
}

.toc-item a:hover {
  color: var(--accent-crimson);
  text-decoration: underline;
}

.toc-item.toc-sub {
  margin-left: 1.25rem;
  font-size: 0.82rem;
}

/* Typography & Justified Content */
.article-body {
  font-family: var(--font-stack);
  font-size: 1.05rem;
  line-height: 1.75;
  color: #272B33;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.article-body p {
  margin-bottom: 1.35rem;
}

.article-body h2 {
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.3;
  margin: 2.25rem 0 0.85rem;
  color: var(--text-dark);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 1.75rem 0 0.65rem;
  color: var(--text-dark);
  text-align: left;
}

.article-body ul, .article-body ol {
  margin: 1rem 0 1.35rem 1.75rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body blockquote {
  border-left: 4px solid var(--accent-crimson);
  background: var(--surface-alt);
  padding: 1rem 1.25rem;
  font-style: italic;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Mobile Responsive Spec Table */
.spec-table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.spec-table th, .spec-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.spec-table th {
  background: var(--surface-alt);
  color: var(--text-dark);
  font-weight: 700;
  width: 30%;
}

.spec-table tr:last-child td, .spec-table tr:last-child th {
  border-bottom: none;
}

/* 1-Click Buy Now Affiliate Button */
.affiliate-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #C92A42 0%, #A61E33 100%);
  color: #FFF !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(201, 42, 66, 0.25);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.affiliate-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(201, 42, 66, 0.35);
  color: #FFF !important;
}

/* Social Share Bar */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.share-label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

.share-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFF;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.share-wa { background: #25D366; }
.share-fb { background: #1877F2; }
.share-x { background: #000; }
.share-copy { background: #475569; cursor: pointer; border: none; }

/* Author Bio Card */
.author-bio-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2.5rem 0;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-color);
}

.bio-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.bio-tag {
  font-size: 0.78rem;
  color: var(--accent-crimson);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.bio-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------------- Dedicated Review Details ---------------- */
.review-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.score-box {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.score-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 4px;
}

.score-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-crimson);
}

/* ---------------- Forms & Alerts ---------------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #FFF;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--accent-crimson);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.35rem;
}

.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.alert-success { background: #DCFCE7; border: 1px solid #86EFAC; color: #166534; }
.alert-error { background: #FEE2E2; border: 1px solid #FCA5A5; color: #991B1B; }

/* ---------------- Footer ---------------- */
.site-footer {
  background: #1B1E24;
  color: #CBD5E1;
  margin-top: auto;
  padding: 3rem 0 1.5rem;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  color: #FFF;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #94A3B8;
}

.footer-links a:hover {
  color: #FFF;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #64748B;
}

/* ---------------- Responsive Breakpoints ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .article-wrapper { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
}

@media (max-width: 768px) {
  .container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  .dashboard-container {
    padding: 1.5rem 1rem !important;
  }

  .form-page-container {
    padding: 1.5rem 1rem !important;
  }

  .auth-container {
    padding: 2rem 1rem !important;
  }

  .custom-page-container {
    padding: 1.5rem 1rem !important;
  }

  .editor-page-container {
    padding: 1.5rem 1rem !important;
  }

  .desktop-actions { display: none !important; }
  .mobile-controls { display: flex !important; }
  .mobile-toggle { display: flex !important; }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 990;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82%;
    max-width: 320px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 2rem 1.25rem;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    display: block;
  }

  .nav-link:hover {
    background: var(--surface-alt);
  }

  .mobile-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .mobile-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-alt);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
  }

  .mobile-user-name { font-weight: 700; color: var(--text-dark); }
  .mobile-user-role { font-size: 0.7rem; font-weight: 800; color: var(--accent-crimson); background: var(--accent-crimson-subtle); padding: 2px 6px; border-radius: 4px; }

  /* Dashboard mobile layout */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions .btn {
    flex: 1 1 100%;
  }

  .form-row-2col {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .article-title { font-size: 1.55rem; line-height: 1.25; }
  .article-byline { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .byline-person { width: 100%; }

  .custom-page-card {
    padding: 1.5rem 1.15rem !important;
  }

  .page-main-title {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
  }

  .form-card {
    padding: 1.5rem 1.15rem !important;
  }

  .dashboard-card {
    padding: 1.25rem 1rem !important;
  }

  /* Spec tables inside article content horizontal scrolling */
  .article-body-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .section-title {
    font-size: 1.2rem !important;
  }

  .hero-banner {
    padding: 1rem 0 !important;
  }

  .hero-overlay {
    padding: 1rem !important;
  }

  .hero-title {
    font-size: 1.15rem !important;
  }

  .author-bio-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 1.25rem 1rem !important;
    gap: 0.85rem !important;
  }

  .share-bar {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .form-card {
    padding: 1.25rem 0.85rem !important;
  }

  .dashboard-card {
    padding: 1rem 0.85rem !important;
  }

  .custom-page-card {
    padding: 1.25rem 0.85rem !important;
  }

  .review-score-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
  }
}

/* ---------------- Ad Placements (Adsterra & Display Ads) ---------------- */
.ad-slot {
  margin: 2rem auto;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  clear: both;
}

.ad-in-article {
  background: var(--surface-alt);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.ad-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
}

.sticky-footer-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  padding: 8px 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-container-inner {
  max-width: 728px;
  width: 100%;
  text-align: center;
  position: relative;
}

.ad-close-btn {
  position: absolute;
  top: -16px;
  right: 12px;
  background: #1E2229;
  color: #FFF;
  border: 2px solid #FFF;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.15s;
  z-index: 10000;
}

.ad-close-btn:hover {
  background: var(--accent-crimson);
}

