/* ==========================================================================
   SIM Details Pakistan - Official Telecom Portal Design System
   Fast Loading, High Contrast, Accessible, Mobile-First CSS
   Enhanced with Dark / Light Theme & Responsive Mobile Header
   ========================================================================== */

:root {
  /* Core Brand Colors */
  --primary: #005b38;
  --primary-dark: #003d25;
  --primary-light: #008753;
  --primary-subtle: #f0fdf4;
  --accent: #d97706;
  --accent-light: #f59e0b;
  --accent-subtle: #fef3c7;

  /* Theme Defaults (Light Theme) */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-header: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #005b38;
  --table-header-bg: #f8fafc;
  --table-row-hover: #f1f5f9;
  --sms-wrapper-bg: #f8fafc;
  --sms-bubble-in: #ffffff;
  --sms-bubble-in-text: #1e293b;
  --lead-bg: #ffffff;
  --nav-hover-bg: rgba(0, 91, 56, 0.08);

  /* Shadows & Radii */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* ==========================================================================
   DARK THEME OVERRIDES
   ========================================================================== */
[data-theme="dark"] {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #34d399;
  --primary-subtle: #064e3b;
  --accent: #fbbf24;
  --accent-light: #f59e0b;
  --accent-subtle: #78350f;

  --bg-body: #090d16;
  --bg-card: #111827;
  --bg-card-subtle: #1f2937;
  --bg-header: #111827;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border-color: #1f2937;
  --border-focus: #10b981;
  --table-header-bg: #1f2937;
  --table-row-hover: #1e293b;
  --sms-wrapper-bg: #0b1120;
  --sms-bubble-in: #1f2937;
  --sms-bubble-in-text: #f8fafc;
  --lead-bg: #111827;
  --nav-hover-bg: rgba(16, 185, 129, 0.15);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-main);
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h1 { font-size: clamp(1.8rem, 3.8vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); margin-top: 0; margin-bottom: 1rem; }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); margin-top: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-top: 1rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.5rem;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.top-notice-bar {
  background: #003d25;
  color: #e2e8f0;
  font-size: 0.82rem;
  padding: 7px 0;
  text-align: center;
  letter-spacing: 0.02em;
}

.top-notice-bar span {
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 700;
  margin-right: 8px;
  font-size: 0.75rem;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  position: relative;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-crest {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 8px rgba(0, 91, 56, 0.25);
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.brand-text h1, .brand-title {
  font-size: 1.25rem;
  color: var(--text-main);
  margin: 0;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: block;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.tab-label-short {
  display: none;
}

.tab-label-full {
  display: inline;
}

/* Header Right Actions (Theme Switcher + Mobile Toggle + Nav) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.main-nav a:hover, .main-nav a.active {
  background: var(--nav-hover-bg);
  color: var(--primary);
  text-decoration: none;
}

.nav-cta-btn {
  background: var(--primary);
  color: #ffffff !important;
  font-weight: 600;
  padding: 9px 18px !important;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0, 91, 56, 0.25);
}

.nav-cta-btn:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--border-color);
  transform: rotate(15deg);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin="round";
}

.theme-toggle-btn .icon-moon { display: block; }
.theme-toggle-btn .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle-btn .icon-sun { display: block; }

/* Hamburger Menu Toggle */
.mobile-toggle {
  display: none;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-toggle:hover {
  background: var(--border-color);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, rgba(0, 91, 56, 0.08) 0%, var(--bg-body) 100%);
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}

.hero-title {
  max-width: 920px;
  margin: 0 auto 16px;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.hero-subtitle {
  max-width: 780px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 1.15rem;
}

/* Interactive Tool Container */
.tool-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 780px;
  margin: 0 auto;
  overflow: hidden;
  text-align: left;
}

.tool-header {
  background: linear-gradient(135deg, #005b38, #003d25);
  color: #ffffff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-header h3 {
  color: #ffffff;
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-security-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tool-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}

.tool-tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.tool-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tool-body {
  padding: 28px 24px;
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.input-control-wrapper {
  position: relative;
  display: flex;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.input-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.submit-btn {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  padding: 15px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 8px -1px rgba(0, 91, 56, 0.3);
}

.submit-btn:hover {
  background: var(--primary-dark);
}

.submit-btn:active {
  transform: scale(0.99);
}

/* Tool Result Box */
.result-box {
  display: none;
  margin-top: 24px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.result-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--primary);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.result-item {
  background: var(--bg-card);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.result-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.official-action-alert {
  background: rgba(37, 99, 235, 0.1);
  border-left: 4px solid #2563eb;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-top: 14px;
}

/* Hero Featured Banner (Placed Below Tool) */
.hero-banner-wrapper {
  max-width: 780px;
  margin: 32px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-banner-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.hero-featured-banner {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumbs span {
  margin: 0 8px;
  color: var(--text-light);
}

/* Quick Stats Banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 28px 0 36px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-top: 4px solid var(--primary);
}

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

.stat-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Structured Section Card */
.content-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.content-section-card:hover {
  box-shadow: var(--shadow-md);
}

.section-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.section-badge-pill.official {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--border-color);
}

.section-badge-pill.warning {
  background: rgba(217, 119, 6, 0.15);
  color: var(--accent);
  border-color: var(--border-color);
}

.section-badge-pill.danger {
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border-color: var(--border-color);
}

/* Process Stepper */
.process-stepper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
}

.step-card:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.step-badge-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 91, 56, 0.2);
}

.step-content-box {
  flex: 1;
}

.step-content-box h4 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  color: var(--text-main);
}

.step-content-box p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-muted);
}

/* Operator Grid */
.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.operator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 5px solid;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.operator-card.jazz { border-top-color: #dc2626; }
.operator-card.zong { border-top-color: #16a34a; }
.operator-card.telenor { border-top-color: #0284c7; }
.operator-card.ufone { border-top-color: #ea580c; }
.operator-card.scom { border-top-color: #4f46e5; }

.operator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.operator-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.operator-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
}

.operator-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.operator-meta strong {
  color: var(--text-main);
}

.code-pill {
  display: inline-block;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  font-family: monospace;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.88rem;
}

/* SMS Chat Simulator Mockup */
.sms-mockup-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.phone-sms-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.sms-card-header {
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
}

.sms-card-body {
  background: var(--sms-wrapper-bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sms-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: var(--shadow-xs);
}

.sms-bubble.outgoing {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.sms-bubble.incoming {
  align-self: flex-start;
  background: var(--sms-bubble-in);
  color: var(--sms-bubble-in-text);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.sms-time {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

.sms-bubble.outgoing .sms-time {
  color: rgba(255, 255, 255, 0.75);
  text-align: right;
}

/* Security Alert Box */
.security-alert-box {
  background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 28px 0;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.security-icon-circle {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.security-text-box h4 {
  color: #fef08a;
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.security-text-box p {
  color: #e2e8f0;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Lead Paragraph */
.lead-p {
  font-size: 1.18rem;
  line-height: 1.85;
  color: var(--text-main);
  font-weight: 500;
  border-left: 5px solid var(--primary);
  padding-left: 20px;
  margin-bottom: 28px;
  background: var(--lead-bg);
  padding-top: 16px;
  padding-bottom: 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border: 1px solid var(--border-color);
  border-left-width: 5px;
  box-shadow: var(--shadow-xs);
}

/* Table of Contents */
.toc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  margin: 28px 0 36px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.toc-list a {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.toc-list a:hover {
  background: var(--nav-hover-bg);
  color: var(--primary);
  text-decoration: none;
  transform: translateX(4px);
}

/* Comparison Tables */
.data-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}

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

.data-table th {
  background: var(--table-header-bg);
  color: var(--text-main);
  padding: 16px 18px;
  font-weight: 800;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--table-row-hover);
}

.badge-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.badge-official {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.badge-warning {
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border: 1px solid var(--border-color);
}

/* Callouts */
.callout {
  padding: 22px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  border-left: 5px solid;
  box-shadow: var(--shadow-xs);
}

.callout-info {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--text-main);
}

.callout-warning {
  background: rgba(217, 119, 6, 0.12);
  border-color: var(--accent);
  color: var(--text-main);
}

.callout-danger {
  background: rgba(220, 38, 38, 0.12);
  border-color: #ef4444;
  color: var(--text-main);
}

.callout h4 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

/* FAQ Accordion */
.faq-container {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  background: var(--bg-card);
  border: none;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.faq-question:hover {
  background: var(--bg-card-subtle);
}

.faq-question.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
}

.faq-icon {
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.2s ease;
  color: var(--text-light);
}

.faq-question.active .faq-icon {
  transform: rotate(45deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 20px 24px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Article & Content Layout */
.main-content-layout {
  display: block;
  max-width: 1060px;
  margin: 0 auto;
  padding: 30px 0 40px;
}

/* Pre-Footer Resources Grid (Above Footer) */
.pre-footer-resources-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 2px solid var(--border-color);
}

.pre-footer-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 24px;
  text-align: center;
}

.pre-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 16px;
}

.single-column-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.content-body {
  background: var(--bg-card);
  padding: 36px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: var(--bg-card);
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.15rem;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.quick-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quick-links-list li {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.quick-links-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
}

.quick-links-list a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Footer */
.site-footer {
  background: #0b1120;
  color: #94a3b8;
  padding: 56px 0 24px;
  margin-top: auto;
  border-top: 4px solid var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #f8fafc;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-light);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET OPTIMIZATIONS)
   ========================================================================== */

@media (max-width: 980px) {
  .main-content-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Mobile Header Transformation */
  .mobile-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-header);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px;
    gap: 10px;
    z-index: 1000;
  }

  .main-nav.show {
    display: flex;
    animation: slideDown 0.25s ease-out;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .main-nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav-cta-btn {
    text-align: center;
    margin-top: 8px;
  }
}

@media (max-width: 680px) {
  .brand-logo {
    gap: 10px;
    max-width: calc(100% - 95px);
  }

  .brand-crest {
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  .brand-text h1, .brand-title {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-text span:not(.brand-title) {
    display: block !important;
    font-size: clamp(0.62rem, 2.2vw, 0.72rem);
    line-height: 1.2;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
  }

  .header-actions {
    gap: 8px;
    flex-shrink: 0;
  }

  .theme-toggle-btn, .mobile-toggle {
    width: 38px;
    height: 38px;
  }

  .stats-banner {
    grid-template-columns: 1fr 1fr;
  }

  .content-section-card {
    padding: 22px 16px;
    margin-bottom: 24px;
  }

  /* Ultra Responsive Tool on Mobile */
  .tool-card {
    border-radius: 14px;
    margin: 0 auto;
    width: 100%;
  }

  .tool-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tool-header h3 {
    font-size: 1.08rem;
    gap: 8px;
    line-height: 1.25;
  }

  .tool-security-tag {
    font-size: 0.72rem;
    padding: 3px 10px;
  }

  .tool-tab-btn {
    padding: 12px 10px;
    font-size: 0.9rem;
    gap: 6px;
    text-align: center;
  }

  .tool-body {
    padding: 20px 16px;
  }

  .input-label {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .input-field {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .input-help {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .submit-btn {
    padding: 13px 18px;
    font-size: 1rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .lead-p {
    font-size: 1.05rem;
    padding-left: 14px;
  }
}

@media (max-width: 480px) {
  .tab-label-full {
    display: none;
  }

  .tab-label-short {
    display: inline;
  }

  .tool-tab-btn {
    padding: 12px 6px;
    font-size: 0.88rem;
    font-weight: 700;
  }

  .tool-tab-btn svg {
    width: 16px;
    height: 16px;
  }

  .tool-header h3 {
    font-size: 1rem;
  }

  .stats-banner {
    grid-template-columns: 1fr;
  }
}
