/* Router Portal: accessible search suggestions and responsive editorial diagrams. */
.portal-search-label a {
  display: block;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.portal-search-label a:hover {
  color: var(--ink, #17304f);
  text-decoration: none;
}

.portal-search-label a:focus-visible {
  border-radius: 6px;
  outline: 2px solid #2f6fed;
  outline-offset: 3px;
}

#home-search-input {
  scroll-margin-top: 6rem;
}

.search-results[hidden] {
  display: none !important;
}

.search-results:not([hidden]) {
  display: block;
}

.search-results a {
  color: var(--ink, #17304f);
  text-decoration: none;
}

.search-results a:hover,
.search-results a:focus-visible {
  background: #f2f6ff;
  outline: 2px solid #2f6fed;
  outline-offset: -2px;
}

.search-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted, #60708c);
}

.search-empty a {
  display: inline;
  padding: 0;
  border: 0;
  color: var(--primary, #2f6fed);
  text-decoration: underline;
}

.demo-hero .search-wrap {
  position: relative;
}

.demo-hero .search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: min(50vh, 400px);
  margin: 0;
  overflow: auto;
  box-shadow: 0 16px 40px rgba(17, 40, 76, .18);
}

.guide-diagram {
  margin: 1.5rem 0;
  padding: .75rem;
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 16px;
  background: #f8faff;
}

.guide-diagram img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 10px;
}

.guide-diagram figcaption {
  padding: .65rem .25rem .1rem;
  color: var(--muted, #60708c);
  font-size: .92rem;
  line-height: 1.5;
}

.guide-topic-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 1rem 0 1.5rem;
  padding: .9rem;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #f8faff;
}

.guide-topic-nav strong {
  flex-basis: 100%;
  color: var(--ink, #17304f);
}

.guide-topic-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .45rem .7rem;
  border: 1px solid #dce5f2;
  border-radius: 999px;
  background: #fff;
  color: var(--primary, #2f6fed);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.guide-topic-nav a:hover,
.guide-topic-nav a:focus-visible {
  border-color: var(--primary, #2f6fed);
  background: #f2f6ff;
  outline: 2px solid var(--primary, #2f6fed);
  outline-offset: 2px;
}

.guide-directory--grouped {
  display: grid;
  gap: 1.4rem;
}

.guide-category {
  scroll-margin-top: 6rem;
}

.guide-category h2 {
  margin: 0 0 .4rem;
}

.guide-category h2 span {
  color: var(--muted, #60708c);
  font-size: .72em;
  font-weight: 500;
}

.guide-category > p {
  margin: 0 0 .75rem;
  color: var(--muted, #60708c);
}

.guide-directory--grouped ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: .55rem .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-directory--grouped li {
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid #e0e8f2;
  border-radius: 10px;
  background: #fff;
}

.guide-directory--grouped li a {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.guide-directory--grouped li span {
  display: block;
  margin-top: .2rem;
  color: var(--muted, #60708c);
  font-size: .82rem;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .guide-diagram {
    margin: 1rem 0;
    padding: .45rem;
    border-radius: 12px;
  }
}

/* Article E-E-A-T Meta Bar */
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.75rem;
  padding: .85rem 1.15rem;
  background: #f8faff;
  border: 1px solid #dce5f2;
  border-radius: 12px;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.meta-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2f6fed;
}

.meta-byline {
  display: block;
  font-size: .95rem;
  color: var(--ink, #17304f);
}

.meta-byline a {
  color: #2f6fed;
  font-weight: 700;
  text-decoration: none;
}

.meta-byline a:hover {
  text-decoration: underline;
}

.meta-role {
  display: block;
  font-size: .8rem;
  color: var(--muted, #60708c);
}

.review-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  background: #ecfdf5;
  color: #065f46;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
}

.meta-date {
  font-size: .8rem;
  color: var(--muted, #60708c);
}

@media (max-width: 600px) {
  .article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .review-meta {
    align-items: flex-start;
  }
}

/* Enhanced Contextual Breadcrumbs */
.breadcrumbs {
  font-size: .88rem;
  color: var(--muted, #60708c);
  margin-bottom: .6rem;
}

.breadcrumbs a {
  color: #2f6fed;
  text-decoration: none;
}

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

.breadcrumbs span.current {
  color: var(--ink, #17304f);
  font-weight: 600;
}

/* E-E-A-T Lab Verification Box */
.eeat-trust-box {
  margin: 2.5rem 0 1.5rem;
  padding: 1.25rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
}

.eeat-trust-box .trust-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #166534;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .45rem;
}

.eeat-trust-box p {
  font-size: .9rem;
  color: #14532d;
  line-height: 1.55;
  margin: 0 0 .75rem;
}

.eeat-trust-box .trust-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .84rem;
}

.eeat-trust-box .trust-links a {
  color: #15803d;
  font-weight: 600;
  text-decoration: underline;
}

/* Homepage Featured Hubs Matrix */
.featured-hubs-section {
  margin: 3rem 0;
}

.featured-hubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem;
  background: #ffffff;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.hub-card:hover {
  transform: translateY(-3px);
  border-color: #2f6fed;
  box-shadow: 0 10px 24px rgba(47, 111, 237, .12);
}

.hub-card-icon {
  font-size: 1.8rem;
  margin-bottom: .6rem;
}

.hub-card h3 {
  margin: 0 0 .4rem;
  font-size: 1.15rem;
  color: #17304f;
}

.hub-card p {
  margin: 0 0 1rem;
  font-size: .88rem;
  color: #60708c;
  line-height: 1.45;
  flex-grow: 1;
}

.hub-card-link {
  font-size: .9rem;
  font-weight: 700;
  color: #2f6fed;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

/* Interactive Router Database & Password Lookup */
.router-db-widget {
  margin: 1.5rem 0 2.5rem;
  padding: 1.5rem;
  background: #f8faff;
  border: 1px solid #dce5f2;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(17, 40, 76, .05);
}

.db-search-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
}

.db-search-input {
  flex: 1;
  padding: .85rem 1.15rem;
  font-size: 1.05rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color .15s ease;
}

.db-search-input:focus {
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .15);
}

.brand-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.25rem;
}

.brand-filter-pill {
  padding: .35rem .75rem;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all .15s ease;
}

.brand-filter-pill:hover,
.brand-filter-pill.active {
  background: #2f6fed;
  color: #ffffff;
  border-color: #2f6fed;
}

.model-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.model-item-card {
  padding: 1.15rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
}

.model-item-card h4 {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.badge-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  white-space: nowrap;
}

.cred-table {
  width: 100%;
  font-size: .88rem;
  margin: .65rem 0;
  border-collapse: collapse;
}

.cred-table td {
  padding: .3rem 0;
}

.cred-table td:first-child {
  color: #64748b;
  width: 38%;
}

.cred-table td:last-child {
  font-weight: 600;
  color: #0f172a;
}

.card-actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

.btn-copy {
  padding: .35rem .65rem;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  transition: background .15s ease;
}

.btn-copy:hover {
  background: #e2e8f0;
}

.btn-open-ip {
  padding: .35rem .65rem;
  font-size: .8rem;
  font-weight: 700;
  border-radius: 6px;
  background: #2f6fed;
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-open-ip:hover {
  background: #1e52b7;
}

.model-notes {
  font-size: .78rem;
  color: #64748b;
  margin-top: .5rem;
  line-height: 1.4;
  border-top: 1px dashed #e2e8f0;
  padding-top: .4rem;
}

/* Gateway Auto-Probe Live Widget */
.auto-probe-widget {
  margin: 1.5rem 0 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 16px;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.25);
}

.probe-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.probe-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.probe-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.auto-probe-widget p {
  color: #94a3b8;
  font-size: .92rem;
  margin: 0 0 1.15rem;
  line-height: 1.5;
}

.probe-btn-detect {
  padding: .75rem 1.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  background: #38bdf8;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s ease;
}

.probe-btn-detect:hover {
  background: #7dd3fc;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.probe-results-box {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: .9rem;
}

.probe-candidate-pill {
  display: inline-block;
  padding: .2rem .5rem;
  margin: .2rem;
  font-size: .78rem;
  border-radius: 4px;
  background: #334155;
  color: #cbd5e1;
}

.probe-candidate-pill.active {
  background: #059669;
  color: #ffffff;
  font-weight: 700;
}

/* Category Hubs & Contextual Internal Linking Grid */
.category-hub-lead {
  background: linear-gradient(135deg, #f0f6ff, #f8faff);
  border: 1px solid #d3e2f8;
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0 28px;
}
.hub-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.hub-card {
  background: #fff;
  border: 1px solid var(--line, #dbe4f2);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.hub-card:hover {
  transform: translateY(-2px);
  border-color: #2f6fed;
  box-shadow: 0 6px 18px rgba(47, 111, 237, 0.1);
  text-decoration: none;
}
.hub-card strong {
  font-size: .96rem;
  color: var(--primary-dark, #164b9e);
}
.hub-card small {
  color: var(--muted, #62718a);
  font-size: .82rem;
  line-height: 1.4;
}
.contextual-related-section {
  margin: 36px 0 16px;
  padding: 24px 20px;
  background: #f8fbfe;
  border: 1px solid #dbe6f5;
  border-radius: 16px;
}
.contextual-related-section h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--primary-dark, #164b9e);
}
.contextual-related-section p {
  margin: 0 0 16px;
  font-size: .88rem;
  color: var(--muted, #62718a);
}
.contextual-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.contextual-card {
  background: #fff;
  border: 1px solid var(--line, #dbe4f2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.contextual-card:hover {
  border-color: #2f6fed;
  box-shadow: 0 4px 14px rgba(47, 111, 237, .08);
  text-decoration: none;
}
.contextual-card strong {
  font-size: .9rem;
  color: var(--ink, #17253d);
}
.contextual-card span {
  font-size: .76rem;
  color: var(--muted, #62718a);
}

/* ==============================================================================
   Multilingual Language Switcher, Arabic RTL & Clean UI Styles (2026 Standard)
   ============================================================================== */

/* Topbar Flex & 5-Language Serial Pill Bar (2026 Sleek Dark Theme) */
.portal-topbar {
  display: block !important;
  background: #091322;
  color: #94a3b8;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 50;
  padding: 4px 16px;
}

.portal-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-topbar-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #64748b;
}

.portal-topbar-status {
  font-size: 0.78rem;
  color: #10b981;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
}

@media (max-width: 768px) {
  .portal-topbar {
    padding: 6px 12px;
  }
  .portal-topbar-inner {
    justify-content: space-between;
  }
}

/* Strict No-Translate Protection for Network Values */
.notranslate,
code,
pre,
.ip-chip,
.model-card-ip,
.model-cred-val {
  translate: no;
}

/* ==============================================================================
   Arabic RTL (Right-to-Left) Styles & International Typography
   ============================================================================== */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] body {
  font-family: 'Cairo', 'Segoe UI Arabic', 'Tahoma', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif !important;
}

[dir="rtl"] .topbar-lang-menu {
  right: auto;
  left: 0;
  text-align: right;
}

[dir="rtl"] .lang-opt {
  text-align: right;
}

[dir="rtl"] .lang-opt.active::after {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .nav-links {
  margin-left: 0 !important;
  margin-right: auto !important;
}

[dir="rtl"] .portal-desktop-nav {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .portal-desktop-nav a {
  margin-left: 0;
  margin-right: 18px;
}

[dir="rtl"] .breadcrumbs {
  direction: rtl;
}

[dir="rtl"] .article-shell {
  direction: rtl;
}

[dir="rtl"] .toc {
  border-left: none !important;
  border-right: 2px solid var(--line, #dbe4f2) !important;
  padding-left: 0 !important;
  padding-right: 16px !important;
}

[dir="rtl"] .notice,
[dir="rtl"] .warning {
  border-left: none !important;
  border-right: 4px solid !important;
}

[dir="rtl"] .checklist .check .step-no {
  margin-right: 0 !important;
  margin-left: 14px !important;
}

[dir="rtl"] .author-meta {
  flex-direction: row;
}

[dir="rtl"] .author-meta div {
  text-align: right;
}

[dir="rtl"] .model-credential-card,
[dir="rtl"] .hub-card,
[dir="rtl"] .help-card,
[dir="rtl"] .contextual-card {
  text-align: right;
}

[dir="rtl"] .model-card-header,
[dir="rtl"] .model-cred-field {
  flex-direction: row-reverse;
}

[dir="rtl"] .mobile-lang-btn {
  text-align: right;
}

/* Viral Share & Tech Community Distribution */
.viral-share-container {
  margin: 2.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(14, 30, 56, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.viral-share-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .viral-share-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.viral-share-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.viral-pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: viralPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes viralPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.viral-share-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

.viral-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.viral-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  color: #f8fafc;
  background: #1e293b;
}

.viral-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

.viral-icon {
  flex-shrink: 0;
}

.viral-btn.viral-copy {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.viral-btn.viral-copy:hover,
.viral-btn.viral-copy.copied {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.viral-btn.viral-reddit {
  background: rgba(255, 69, 0, 0.15);
  color: #ff6522;
  border-color: rgba(255, 69, 0, 0.35);
}

.viral-btn.viral-reddit:hover {
  background: #ff4500;
  color: #ffffff;
  border-color: #ff4500;
}

.viral-btn.viral-x {
  background: rgba(248, 250, 252, 0.1);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.25);
}

.viral-btn.viral-x:hover {
  background: #000000;
  color: #ffffff;
  border-color: #475569;
}

.viral-btn.viral-whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.35);
}

.viral-btn.viral-whatsapp:hover {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}

.viral-btn.viral-share-native {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border-color: rgba(147, 51, 234, 0.35);
}

.viral-btn.viral-share-native:hover {
  background: #9333ea;
  color: #ffffff;
  border-color: #9333ea;
}

/* ==========================================================================
   Mobile UX, Touch Target & CLS Safeguards (Audited 2026 Standards)
   ========================================================================== */

/* 1. Pilot Pages Table-Wrap Responsive Alias */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  max-width: 100%;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  background: #fff;
}
.table-wrap th, .table-wrap td {
  border: 1px solid var(--line, #e2e8f0);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}
.table-wrap th {
  background: #f3f7fd;
  color: #1e3a8a;
  font-weight: 700;
}

/* 2. Password DB CLS Prevention & Mobile Grid */
.model-results-grid {
  min-height: 540px;
}
@media (max-width: 500px) {
  .router-db-widget {
    padding: 1rem .75rem;
  }
  .model-results-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Credential Copy Buttons System Styling */
.btn-copy-cred {
  padding: .45rem .85rem;
  min-height: 44px;
  min-width: 44px;
  font-size: .85rem;
  font-weight: 700;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.btn-copy-cred:hover {
  background: #1d4ed8;
}

/* 4. Touch Targets & Mobile Viral Share Layout */
.viral-btn {
  min-height: 44px;
  padding: 0.6rem 0.95rem;
  font-size: 0.88rem;
}
@media (max-width: 600px) {
  .viral-share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .viral-btn.viral-copy {
    grid-column: 1 / -1;
  }
}

/* 5. Topbar Flex Truncation Bug Fix */
.portal-topbar-text {
  min-width: 0;
  flex: 1 1 auto;
}

/* 6. Brand Filter Pills & TOC Touch Targets */
.brand-filter-pill {
  min-height: 44px;
  padding: .5rem 1rem;
  display: inline-flex;
  align-items: center;
}
@media (max-width: 900px) {
  .toc a {
    padding: 8px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* 7. Code & Pre Terminal Styling */
pre,
.code-block {
  position: relative;
  background: #0f172a;
  color: #38bdf8;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #1e293b;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.25rem 0;
}
pre::before,
.code-block::before {
  content: "Command Terminal / Diagnostic Output";
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
pre code,
.code-block code {
  color: #38bdf8 !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
}

/* 8. Wi-Fi Password Strength & Crack Time Estimator Styles */
.wifi-strength-tool {
  background: #ffffff;
  border: 1px solid #c9d8ef;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin: 1.5rem 0 2.5rem;
}

.tool-privacy-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #065f46;
  margin-bottom: 1.5rem;
  line-height: 1.45;
}

.tool-privacy-badge .lock-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.strength-input-group label {
  display: block;
  font-weight: 700;
  color: #0f172a;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.strength-input-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#wifi-pass-input {
  width: 100%;
  padding: 0.95rem 5.5rem 0.95rem 1rem;
  font-size: 1.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  min-height: 52px;
}

#wifi-pass-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-toggle-eye, .btn-clear {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-size: 1.15rem;
  color: #64748b;
  min-height: 48px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.btn-toggle-eye {
  right: 2.75rem;
}

.btn-clear {
  right: 0.35rem;
}

.btn-toggle-eye:hover, .btn-clear:hover {
  color: #0f172a;
}

.input-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.input-meta span {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.optional-ssid-group {
  margin-top: 1.25rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.9rem;
}

.optional-ssid-group details summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2563eb;
  outline: none;
  user-select: none;
}

.optional-ssid-group input {
  width: 100%;
  max-width: 400px;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  margin-top: 0.4rem;
  min-height: 48px;
}

/* Strength Meter Section */
.strength-meter-section {
  margin-top: 1.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meter-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
}

.meter-status {
  font-size: 1rem;
  font-weight: 800;
  color: #64748b;
  transition: color 0.2s;
}

.meter-bar-track {
  width: 100%;
  height: 14px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.meter-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  background: #94a3b8;
}

.meter-bar-fill.critical { background: #ef4444; }
.meter-bar-fill.weak { background: #f97316; }
.meter-bar-fill.moderate { background: #f59e0b; }
.meter-bar-fill.strong { background: #10b981; }
.meter-bar-fill.diceware { background: linear-gradient(90deg, #10b981, #06b6d4); }

.meter-scale-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* Hardware Attack Grid */
.hardware-attack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.hw-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s, border-color 0.2s;
}

.hw-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.hw-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.hw-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.hw-rate {
  font-size: 0.8rem;
  color: #64748b;
}

.hw-time {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: auto;
  padding-top: 0.5rem;
  word-break: break-word;
}

.hw-card.fast-crack .hw-time { color: #dc2626; }
.hw-card.med-crack .hw-time { color: #ea580c; }
.hw-card.slow-crack .hw-time { color: #16a34a; }
.hw-card.impossible .hw-time { color: #0284c7; }

/* Cryptographic Audit Drawer */
.crypto-audit-box {
  margin-top: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
}

.crypto-audit-box h4 {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  color: #1e293b;
}

.vulnerability-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
}

.vulnerability-list li {
  margin-bottom: 0.35rem;
}

.vuln-warn {
  color: #b91c1c;
  font-weight: 600;
}

.vuln-ok {
  color: #047857;
  font-weight: 600;
}

/* Diceware Generator */
.diceware-generator-card {
  margin-top: 1.75rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 1.25rem;
}

.diceware-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.diceware-output-box {
  margin-top: 1rem;
  background: #ffffff;
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.diceware-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: #047857;
  letter-spacing: 0.03em;
}

.diceware-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-copy-small {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease;
}

.btn-copy-small:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

#btn-use-diceware {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

#btn-use-diceware:hover {
  background: #059669;
}

/* Share Badge Bar */
.share-badge-bar {
  margin-top: 1.5rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-badge-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-weight: 700;
  color: #1e293b;
  font-size: 0.95rem;
}

.btn-share-badge {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s;
}

.btn-share-badge:hover {
  background: #1d4ed8;
}

@media (max-width: 768px) {
  .hardware-attack-grid {
    grid-template-columns: 1fr;
  }
  .meter-scale-markers {
    font-size: 0.68rem;
  }
  .diceware-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .diceware-head button {
    width: 100%;
  }
  .diceware-output-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .diceware-actions {
    width: 100%;
    flex-direction: column;
  }
  .diceware-actions button {
    width: 100%;
  }
  .share-badge-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-share-badge {
    width: 100%;
  }
}

/* 9. Router Ping, Jitter & LAN Latency Meter Styles */
.ping-tool-card {
  background: #ffffff;
  border: 1px solid #c9d8ef;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin: 1.5rem 0 2.5rem;
}

.ping-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
  background: #f8fafc;
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
}

.ping-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ping-control-group label {
  font-size: 0.88rem;
  color: #334155;
  font-weight: 700;
}

.ping-select, #ping-custom-target {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  min-height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ping-select:focus, #ping-custom-target:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ping-action-group {
  display: flex;
  align-items: flex-end;
}

.ping-action-group .button {
  width: 100%;
  min-height: 48px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ping-action-group .button.running {
  background: #ef4444 !important;
  border-color: #dc2626 !important;
}

.ping-status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: #f1f5f9;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 1.25rem;
}

.ping-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.ping-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pingPulse 1.5s infinite ease-in-out;
}

.ping-status-dot.stopped {
  background: #f59e0b;
}

@keyframes pingPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.ping-canvas-container {
  background: #0f172a;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.ping-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.canvas-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.current-rtt-badge {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.canvas-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #1e293b;
}

#ping-canvas {
  width: 100%;
  height: 140px;
  display: block;
}

.ping-canvas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.dot-green { background: #10b981; }
.legend-dot.dot-yellow { background: #f59e0b; }
.legend-dot.dot-red { background: #ef4444; }

.ping-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ping-metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ping-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.2;
}

.grade-badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 6px;
  font-size: 1.4rem;
}

.grade-badge.grade-a-plus { background: #dcfce7; color: #15803d; }
.grade-badge.grade-a { background: #ecfdf5; color: #047857; }
.grade-badge.grade-b { background: #fef3c7; color: #b45309; }
.grade-badge.grade-c { background: #ffedd5; color: #c2410c; }
.grade-badge.grade-f { background: #fee2e2; color: #b91c1c; }

.metric-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.35rem;
  font-weight: 500;
}

.ping-diagnostic-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.ping-diagnostic-card h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.diagnostic-body {
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.5;
}

.diagnostic-item {
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  border-left: 3px solid #3b82f6;
}

.diagnostic-item:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .ping-controls-grid {
    grid-template-columns: 1fr;
  }
  .ping-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ping-metrics-grid #card-grade {
    grid-column: span 2;
  }
}





 ==========================================================================
   Tool #3: Wi-Fi 2.4 GHz, 5 GHz & 6 GHz Channel Spectrum Visualizer
   Mobile-First, WCAG AAA Contrast Compliant, 48x48px Minimum Touch Targets
   ========================================================================== */

/* 1. Main Tool Container */
#wifi-spectrum-tool,
.spectrum-tool-card {
  background: #ffffff;
  border: 1px solid #c9d8ef;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin: 1.5rem 0 2.5rem;
  color: #0f172a;
}

/* 2. Tool Architecture & Client-Side Privacy Badge */
.spectrum-privacy-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #14532d;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.spectrum-privacy-badge .badge-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

/* 3. Spectrum Band Switcher Tabs (2.4 GHz, 5 GHz, 6 GHz) */
.spectrum-band-tabs {
  display: flex;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
}

.spectrum-band-tab {
  flex: 1;
  min-height: 48px;
  min-width: 48px;
  padding: 0.6rem 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: #334155;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.spectrum-band-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.75);
  color: #0f172a;
}

.spectrum-band-tab.active {
  background: #ffffff;
  color: #1d4ed8;
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  font-weight: 800;
}

.spectrum-band-tab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.spectrum-band-tab .band-freq {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.spectrum-band-tab .band-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.spectrum-band-tab.active .band-tag {
  background: #dbeafe;
  color: #1e40af;
}

/* 4. Channel Width Pill Buttons (20 MHz, 40 MHz, 80 MHz, 160 MHz, 320 MHz) */
.spectrum-width-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.spectrum-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spectrum-control-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spectrum-control-hint {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
}

.spectrum-width-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.width-pill {
  min-height: 48px;
  min-width: 48px;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.width-pill:hover:not(:disabled):not(.active) {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.width-pill.active {
  background: #1d4ed8;
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
  font-weight: 800;
}

.width-pill:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

.width-pill:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.width-pill .pill-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  color: inherit;
}

.width-pill.active .pill-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* 5. Quick Channel Picker (Interactive Channel Badges) */
.spectrum-channel-picker {
  margin-bottom: 1.25rem;
}

.channel-badges-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 4px 2px;
}

.channel-badge-btn {
  min-height: 48px;
  min-width: 48px;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.channel-badge-btn:hover:not(.active) {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.channel-badge-btn .badge-ch-num {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.1;
}

.channel-badge-btn .badge-ch-sub {
  font-size: 0.68rem;
  color: #475569;
  font-weight: 600;
  line-height: 1;
  margin-top: 2px;
}

/* Semantic channel status indicators */
.channel-badge-btn.is-recommended {
  border-color: #10b981;
  background: #f0fdf4;
  color: #065f46;
}

.channel-badge-btn.is-dfs {
  border-color: #c084fc;
  background: #faf5ff;
  color: #6b21a8;
}

.channel-badge-btn.is-psc {
  border-color: #06b6d4;
  background: #ecfeff;
  color: #0e7490;
}

.channel-badge-btn.is-overlapping {
  border-color: #fed7aa;
  background: #fffbeb;
  color: #9a3412;
}

/* Active Channel State */
.channel-badge-btn.active {
  background: #0f172a;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 0 2px #38bdf8, 0 4px 12px rgba(15, 23, 42, 0.2);
}

.channel-badge-btn.active .badge-ch-sub {
  color: #94a3b8;
}

.channel-badge-btn.is-recommended.active {
  background: #065f46;
  border-color: #34d399;
  box-shadow: 0 0 0 2px #34d399, 0 4px 12px rgba(6, 95, 70, 0.25);
  color: #ffffff;
}

.channel-badge-btn.is-recommended.active .badge-ch-sub {
  color: #a7f3d0;
}

.channel-badge-btn.is-dfs.active {
  background: #581c87;
  border-color: #c084fc;
  box-shadow: 0 0 0 2px #c084fc, 0 4px 12px rgba(88, 28, 135, 0.25);
  color: #ffffff;
}

.channel-badge-btn.is-dfs.active .badge-ch-sub {
  color: #e9d5ff;
}

.channel-badge-btn.is-psc.active {
  background: #0e7490;
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px #22d3ee, 0 4px 12px rgba(14, 116, 144, 0.25);
  color: #ffffff;
}

.channel-badge-btn.is-psc.active .badge-ch-sub {
  color: #a5f3fc;
}

.channel-badge-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* 6. Canvas Container (Dark Contrast RF Spectrum Display) */
.spectrum-canvas-wrap {
  position: relative;
  width: 100%;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 16px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.65), 0 10px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.spectrum-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid #1e293b;
  font-size: 0.82rem;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.canvas-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
}

.canvas-readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

#wifi-spectrum-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  max-height: 440px;
  image-rendering: -webkit-optimize-contrast;
  touch-action: pan-y;
}

.spectrum-canvas-hint {
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  padding: 0.4rem;
  background: rgba(9, 13, 22, 0.95);
  border-top: 1px solid #1e293b;
}

/* 7. Legend Bar with Visual Color Indicators */
.spectrum-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.spectrum-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.swatch-active {
  background: #38bdf8;
  border: 1.5px solid #0284c7;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.swatch-recommended {
  background: #10b981;
  border: 1.5px solid #059669;
}

.swatch-interfering {
  background: #f59e0b;
  border: 1.5px solid #d97706;
}

.swatch-dfs {
  background: repeating-linear-gradient(45deg, #a855f7, #a855f7 3px, #7e22ce 3px, #7e22ce 6px);
  border: 1.5px solid #6b21a8;
}

.swatch-psc {
  background: #06b6d4;
  border: 1.5px solid #0891b2;
}

/* 8. Channel Recommendation Result Card */
.spectrum-recommendation-card {
  background: #ffffff;
  border: 1.5px solid #bbf7d0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
  margin-top: 1.5rem;
}

.recommendation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.85rem;
}

.recommendation-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #065f46;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendation-badge {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.rec-metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.rec-metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.rec-metric-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.rec-metric-sub {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.2rem;
  font-weight: 600;
}

.recommendation-explanation {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.55;
}

.recommendation-explanation strong {
  color: #065f46;
}

.rec-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn-rec-action {
  min-height: 48px;
  min-width: 48px;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
  user-select: none;
  border: 1.5px solid transparent;
}

.btn-rec-action.primary {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1e40af;
}

.btn-rec-action.primary:hover {
  background: #1e40af;
}

.btn-rec-action.secondary {
  background: #ffffff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-rec-action.secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-rec-action:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* 9. Mobile-First Responsive Adjustments */
@media (max-width: 768px) {
  #wifi-spectrum-tool,
  .spectrum-tool-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .spectrum-band-tabs {
    flex-direction: column;
    gap: 0.35rem;
  }

  .spectrum-band-tab {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 1rem;
  }

  .spectrum-width-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .spectrum-width-pills .width-pill:last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .channel-badges-scroll {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
  }

  .channel-badge-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    min-width: 52px;
  }

  .spectrum-legend-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

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

  .recommendation-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .rec-actions {
    flex-direction: column;
  }

  .btn-rec-action {
    width: 100%;
  }

  #wifi-spectrum-canvas {
    aspect-ratio: 4 / 3;
    min-height: 240px;
  }
}


/* ==========================================================================
   Tool #3: Wi-Fi Spectrum & Overlap Visualizer - Core Web Vitals & Mobile CSS
   CLS: Strict 0.00 | Passive Scrolling | WCAG AAA Contrast | >= 48px Targets
   ========================================================================== */

.spectrum-tool-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  contain: layout style;
}

/* 1. Band Selection Bar (Touch Target >= 48px, Gap 8px) */
.spectrum-band-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spectrum-tab-btn {
  flex: 1;
  min-height: 48px;
  min-width: 96px;
  border: none;
  background: transparent;
  color: #334155; /* WCAG AAA 10.3:1 */
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.5rem 1rem;
}

.spectrum-tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.spectrum-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.spectrum-tab-btn:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

/* 2. Controls Grid (Widths & Channel Picker) */
.spectrum-controls-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  min-height: 52px; /* Reserves layout space against CLS */
}

.spectrum-width-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.spectrum-control-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-right: 4px;
}

.spectrum-width-btn {
  min-height: 48px;
  min-width: 58px;
  padding: 0.65rem 1rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spectrum-width-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.spectrum-width-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.spectrum-width-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.spectrum-channel-selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spectrum-select-input {
  min-height: 48px;
  height: 48px;
  padding: 0 1rem;
  font-size: 16px; /* Prevents auto-zoom on iOS */
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}

.spectrum-select-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* 3. Strict CLS = 0.00 Canvas Container & Passive Scroll */
.spectrum-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  max-height: 460px;
  background: #0b0f19;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.25rem;
  contain: layout size style;
  contain-intrinsic-size: 100% 320px;
}

#spectrum-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y; /* Crucial: never block vertical mobile scrolling */
  cursor: crosshair;
}

/* 4. Canvas Header & Interactive Overlay */
.spectrum-canvas-header {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.spectrum-canvas-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1; /* WCAG AAA 12.9:1 */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.spectrum-canvas-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(4px);
}

/* 5. Telemetry & Overlap Diagnostics Drawer (min-height prevents CLS) */
.spectrum-telemetry-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  min-height: 128px; /* Strict CLS reservation */
  contain: layout;
}

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

.telemetry-item {
  display: flex;
  flex-direction: column;
}

.telemetry-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569; /* WCAG AAA 7.58:1 on light */
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.telemetry-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a; /* WCAG AAA 17.85:1 */
}

.telemetry-desc {
  font-size: 0.82rem;
  color: #334155; /* WCAG AAA 10.35:1 */
  margin-top: 0.2rem;
}

/* Alert States in Telemetry */
.badge-clean { color: #15803d; font-weight: 700; }
.badge-dfs { color: #7e22ce; font-weight: 700; }
.badge-psc { color: #047857; font-weight: 700; }
.badge-overlap { color: #b91c1c; font-weight: 700; }

/* 6. Quick Action Row */
.spectrum-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.spectrum-action-btn {
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease-in-out;
}

.spectrum-action-btn.primary {
  background: #2563eb;
  color: #ffffff;
}

.spectrum-action-btn.primary:hover {
  background: #1d4ed8;
}

.spectrum-action-btn.secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
}

.spectrum-action-btn.secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Mobile Media Queries */
@media (max-width: 640px) {
  .spectrum-tool-card {
    padding: 1rem;
    margin: 1.25rem 0;
  }
  .spectrum-canvas-container {
    aspect-ratio: 4 / 3;
    min-height: 260px;
  }
  .spectrum-band-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .spectrum-tab-btn {
    min-width: 84px;
    font-size: 0.88rem;
  }
  .spectrum-controls-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .spectrum-width-group {
    justify-content: flex-start;
  }
  .spectrum-channel-selector-group {
    width: 100%;
    justify-content: space-between;
  }
  .spectrum-select-input {
    flex: 1;
  }
  .telemetry-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* ==========================================================================
   Tool #4: Game & Application Port Forwarding Rule Generator Engine
   - 100% Client-Side RFC 1918 Validation & CGNAT Diagnostic Checker
   - Responsive Rule Worksheet & Multi-Brand Router Navigation Steps
   - Dynamic CLI Code Generator (OpenWrt, iptables, nftables, MikroTik)
   ========================================================================== */

#port-forwarding-tool,
.pf-tool-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  font-family: inherit;
  color: #1e293b;
}

.pf-privacy-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #166534;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.pf-privacy-badge .lock-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Category Filter Tabs */
.pf-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
}

.pf-cat-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pf-cat-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pf-cat-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Controls Grid */
.pf-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.pf-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pf-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.pf-search-box {
  margin-bottom: 0.35rem;
}

.pf-search-input,
.pf-select-input,
.pf-text-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
}

.pf-search-input:focus,
.pf-select-input:focus,
.pf-text-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pf-app-summary-note {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
  min-height: 1.2rem;
}

.pf-ip-status {
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.pf-ip-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.pf-ip-badge.valid {
  background: #dcfce7;
  color: #166534;
}

.pf-ip-badge.invalid {
  background: #fee2e2;
  color: #991b1b;
}

.pf-brand-meta {
  font-size: 0.8rem;
  color: #475569;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* CGNAT Diagnostic Alert Box */
.pf-cgnat-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.pf-cgnat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.pf-cgnat-body p {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  color: #78350f;
  line-height: 1.45;
}

.pf-cgnat-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pf-cgnat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #92400e;
}

.pf-cgnat-input {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem 0.7rem;
  border: 1px solid #d97706;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #ffffff;
}

.pf-cgnat-result {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.pf-cgnat-result.cgnat-detected {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.pf-cgnat-result.public-ok {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.pf-cgnat-result.double-nat {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}

/* Worksheet Table */
.pf-worksheet-section {
  margin-bottom: 1.5rem;
}

.pf-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.pf-section-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.pf-rule-counter {
  font-size: 0.82rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.pf-table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

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

.pf-rules-table th {
  background: #f8fafc;
  padding: 0.7rem 0.85rem;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.pf-rules-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.pf-rules-table tr:hover td {
  background: #f8fafc;
}

.pf-badge-proto {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
}

.pf-badge-proto.tcp {
  background: #dbeafe;
  color: #1d4ed8;
}

.pf-badge-proto.udp {
  background: #fef3c7;
  color: #b45309;
}

.pf-badge-proto.both {
  background: #dcfce7;
  color: #15803d;
}

.pf-port-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #0f172a;
}

.pf-btn-del {
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pf-btn-del:hover {
  background: #fecaca;
}

/* Custom Port Add Row */
.pf-add-custom-bar {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.pf-add-custom-bar h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #334155;
}

.pf-custom-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pf-custom-inputs input,
.pf-custom-inputs select {
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #ffffff;
}

.pf-custom-inputs input:first-child {
  flex: 2;
  min-width: 140px;
}

.pf-custom-inputs input[type="text"]:not(:first-child) {
  flex: 1;
  min-width: 90px;
}

/* Brand Guide Card */
.pf-brand-guide-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.pf-brand-guide-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #0369a1;
}

.pf-guide-steps ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #0c4a6e;
}

.pf-guide-steps ol li {
  margin-bottom: 0.4rem;
}

.pf-guide-steps strong {
  color: #0369a1;
}

/* CLI Rule Generator Section */
.pf-cli-section {
  background: #0f172a;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  color: #f8fafc;
}

.pf-cli-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.pf-cli-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #38bdf8;
}

.pf-cli-hint {
  font-size: 0.8rem;
  color: #94a3b8;
}

.pf-cli-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.5rem;
}

.pf-cli-tab {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pf-cli-tab:hover {
  background: #334155;
  color: #ffffff;
}

.pf-cli-tab.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.pf-cli-code-container {
  position: relative;
}

.pf-code-block {
  margin: 0;
  padding: 1rem;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
}

.pf-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pf-copy-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
}

/* Actions Bar */
.pf-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
}

.pf-btn {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.pf-btn.primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.pf-btn.primary:hover {
  background: #1d4ed8;
}

.pf-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.pf-btn.secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pf-btn.text-only {
  background: transparent;
  color: #64748b;
  border-color: transparent;
}

.pf-btn.text-only:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #port-forwarding-tool,
  .pf-tool-card {
    padding: 1rem;
    margin: 1.25rem 0;
  }
  .pf-controls-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .pf-cgnat-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .pf-custom-inputs {
    flex-direction: column;
  }
  .pf-custom-inputs input,
  .pf-custom-inputs select,
  .pf-custom-inputs button {
    width: 100%;
  }
  .pf-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .pf-btn {
    text-align: center;
  }
}


/* ==========================================================================
   Tool #5: Visual CIDR & IPv4 Subnet Calculator Engine
   - Real-time 32-Bit Binary Bitmask Inspector & Visual Network/Host Boundary
   - Proportional Address Space Allocation Bar & Usable IP Host Pool
   - Comprehensive Telemetry Grid with 1-Click Copy on All Parameters
   - Multi-Tier Subnet Partitioning Matrix (VLSM Subnet Splitter)
   - 1-Click Cisco IOS, Linux iproute2, Netplan, MikroTik & PowerShell CLI
   ========================================================================== */

#cidr-subnet-tool,
.cidr-tool-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  font-family: inherit;
  color: #1e293b;
}

.cidr-privacy-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #166534;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.cidr-privacy-badge .lock-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Quick Presets Row */
.cidr-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
}

.cidr-preset-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  margin-right: 0.25rem;
}

.cidr-preset-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cidr-preset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cidr-preset-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Input Panel Grid */
.cidr-input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.cidr-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cidr-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.cidr-text-input,
.cidr-select-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.92rem;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cidr-text-input:focus,
.cidr-select-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cidr-input-hint {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

/* Slider Controls Panel */
.cidr-slider-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.cidr-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.cidr-slider-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

.cidr-slider-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cidr-range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin: 0.5rem 0;
}

.cidr-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease;
}

.cidr-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.cidr-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Visual 32-Bit Binary Bitmask Inspector */
.cidr-bitmask-card {
  background: #0f172a;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  color: #f8fafc;
}

.cidr-bitmask-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cidr-bitmask-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #38bdf8;
}

.cidr-bitmask-legend {
  display: flex;
  gap: 0.85rem;
  font-size: 0.78rem;
}

.cidr-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cidr-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.cidr-legend-dot.net {
  background: #38bdf8;
}

.cidr-legend-dot.host {
  background: #475569;
}

.cidr-octets-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cidr-octet-block {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.6rem 0.5rem;
  text-align: center;
}

.cidr-octet-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  padding: 0 0.2rem;
}

.cidr-bits-row {
  display: flex;
  justify-content: space-around;
  gap: 2px;
}

.cidr-bit {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.2rem 0.25rem;
  border-radius: 3px;
  transition: all 0.15s ease;
  line-height: 1;
}

.cidr-bit.net {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.cidr-bit.host {
  background: rgba(148, 163, 184, 0.1);
  color: #64748b;
  border: 1px solid #334155;
}

.cidr-octet-decimal {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Address Allocation Graphical Bar */
.cidr-bar-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.cidr-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.cidr-bar-wrapper {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 0.5rem;
}

.cidr-bar-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cidr-bar-seg.network {
  background: #0284c7;
  min-width: 8px;
}

.cidr-bar-seg.usable {
  background: #16a34a;
  flex: 1;
}

.cidr-bar-seg.broadcast {
  background: #9333ea;
  min-width: 8px;
}

.cidr-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
}

/* Telemetry Grid */
.cidr-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cidr-tele-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.15s ease;
}

.cidr-tele-item:hover {
  border-color: #cbd5e1;
}

.cidr-tele-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cidr-tele-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.cidr-tele-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}

.cidr-copy-chip {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cidr-copy-chip:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Subnet Splitter Partition Matrix */
.cidr-splitter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.cidr-splitter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cidr-splitter-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.cidr-splitter-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cidr-split-select {
  padding: 0.35rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #ffffff;
}

.cidr-split-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.cidr-split-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.cidr-split-table th {
  background: #f8fafc;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.cidr-split-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cidr-split-table tr:hover td {
  background: #f8fafc;
}

/* CLI Export Section */
.cidr-cli-card {
  background: #0f172a;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  color: #f8fafc;
}

.cidr-cli-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cidr-cli-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #38bdf8;
}

.cidr-cli-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.5rem;
}

.cidr-cli-tab {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cidr-cli-tab:hover {
  background: #334155;
  color: #ffffff;
}

.cidr-cli-tab.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.cidr-cli-code-container {
  position: relative;
}

.cidr-code-block {
  margin: 0;
  padding: 1rem;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
}

.cidr-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cidr-copy-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
}

/* Actions Bar */
.cidr-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
}

.cidr-btn {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.cidr-btn.primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.cidr-btn.primary:hover {
  background: #1d4ed8;
}

.cidr-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.cidr-btn.secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cidr-btn.text-only {
  background: transparent;
  color: #64748b;
  border-color: transparent;
}

.cidr-btn.text-only:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #cidr-subnet-tool,
  .cidr-tool-card {
    padding: 1rem;
    margin: 1.25rem 0;
  }
  .cidr-input-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .cidr-octets-container {
    grid-template-columns: 1fr 1fr;
  }
  .cidr-telemetry-grid {
    grid-template-columns: 1fr;
  }
  .cidr-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .cidr-btn {
    text-align: center;
  }
}


/* ==========================================================================
   Tool #6: Private Client-Side Wi-Fi QR Code Generator & Guest Card Engine
   - 100% Offline Client-Side QR Vector & Canvas Rendering (Zero Telemetry)
   - Live Customizer (SSID, Password, WPA3-SAE, Hidden SSID, Colors, ECC)
   - Designer Printable Guest Card Templates (Minimalist, Cafe Tent, Dark Tech)
   - High-Res PNG, Scalable SVG, Raw WIFI URI & 1-Click Print Media Styling
   ========================================================================== */

#wifi-qr-tool,
.qr-tool-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  font-family: inherit;
  color: #1e293b;
}

.qr-privacy-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #166534;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.qr-privacy-badge .lock-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Designer Layout Grid */
.qr-designer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Controls Column */
.qr-controls-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qr-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.qr-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  justify-content: space-between;
}

.qr-text-input,
.qr-select-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.92rem;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
}

.qr-text-input:focus,
.qr-select-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.qr-pass-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.qr-pass-input {
  width: 100%;
  padding: 0.55rem 2.5rem 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.92rem;
  background: #ffffff;
}

.qr-btn-eye {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #64748b;
  padding: 0.25rem;
}

.qr-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: #334155;
  cursor: pointer;
}

.qr-checkbox-row input {
  cursor: pointer;
}

.qr-customizer-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.qr-color-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qr-color-input {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: none;
}

/* Preview Column & Card Templates */
.qr-preview-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qr-template-nav {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.qr-temp-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qr-temp-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.qr-temp-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Printable Card Container */
.qr-card-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 1.5rem;
  min-height: 360px;
}

/* Template 1: Minimalist Modern (Default) */
.qr-print-card {
  width: 100%;
  max-width: 340px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.qr-print-card.theme-minimalist {
  border: 2px solid #e2e8f0;
  color: #0f172a;
}

.qr-print-card.theme-cafe {
  border: 2px solid #d97706;
  background: #fffbeb;
  color: #78350f;
}

.qr-print-card.theme-dark {
  border: 2px solid #334155;
  background: #0f172a;
  color: #f8fafc;
}

.qr-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}

.theme-minimalist .qr-card-badge {
  background: #eff6ff;
  color: #2563eb;
}

.theme-cafe .qr-card-badge {
  background: #fef3c7;
  color: #b45309;
}

.theme-dark .qr-card-badge {
  background: #1e293b;
  color: #38bdf8;
}

.qr-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.2rem 0 0.25rem;
  line-height: 1.2;
}

.qr-card-subtitle {
  font-size: 0.84rem;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.qr-code-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1rem;
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  width: 190px;
  height: 190px;
  box-sizing: border-box;
}

.qr-code-box svg,
.qr-code-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-card-details {
  border-top: 1px dashed rgba(100, 116, 139, 0.3);
  padding-top: 0.75rem;
  font-size: 0.86rem;
  text-align: left;
}

.qr-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  word-break: break-all;
}

.qr-detail-label {
  font-weight: 600;
  opacity: 0.75;
}

.qr-detail-val {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.qr-card-footer {
  margin-top: 0.65rem;
  font-size: 0.74rem;
  opacity: 0.7;
}

/* Raw Payload Display */
.qr-payload-card {
  background: #0f172a;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: #e2e8f0;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}

.qr-payload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: #38bdf8;
}

.qr-payload-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
  background: #020617;
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
  margin: 0;
  color: #a5f3fc;
  font-size: 0.8rem;
}

/* Actions Row */
.qr-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.qr-btn {
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.qr-btn.primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.qr-btn.primary:hover {
  background: #1d4ed8;
}

.qr-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.qr-btn.secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #wifi-qr-tool,
  .qr-tool-card {
    padding: 1rem;
    margin: 1.25rem 0;
  }
  .qr-designer-grid {
    grid-template-columns: 1fr;
  }
  .qr-customizer-panel {
    grid-template-columns: 1fr;
  }
  .qr-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .qr-btn {
    justify-content: center;
  }
}

/* Dedicated Print Stylesheet: Prints ONLY the guest card! */
@media print {
  body * {
    visibility: hidden;
  }
  #wifi-printable-card,
  #wifi-printable-card * {
    visibility: visible;
  }
  #wifi-printable-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    box-shadow: none;
    border: 2px solid #000000;
    margin: 0;
    padding: 2rem;
  }
}

/* ==========================================================================
   Day 1: IP PageRank Bridge (3-CTA Diagnostic Action Panel)
   Distributes authority across 388 IP pages to Tier-1 high-conversion tools
   ========================================================================== */
.ip-pagerank-bridge {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0b1528 0%, #172554 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.35);
}

.bridge-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.bridge-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(96, 165, 250, 0.4);
}

.bridge-badge {
  align-self: flex-start;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
  margin-bottom: 0.75rem;
}

.bridge-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.35;
}

.bridge-card p {
  margin: 0 0 1rem 0;
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.5;
  flex-grow: 1;
}

.bridge-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.bridge-link:hover {
  color: #93c5fd;
  text-decoration: underline;
  transform: translateX(2px);
}

@media (max-width: 900px) {
  .ip-pagerank-bridge {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }
}



/* ==========================================================================
   DAY 2 TIER-1 TOOLS MODERNIZATION: PORT CHECKER & CGNAT DETECTOR
   ========================================================================== */

/* ==========================================================================
   Tool Component: Open Port Checker & Firewall Tester (/tools/port-checker/)
   Design System: #0f172a Slate Theme, Zero-Ad, Mobile Responsive, WCAG AAA
   ========================================================================== */

.port-checker-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  margin: 1.5rem 0 2.5rem;
  position: relative;
}

.pc-config-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.2fr 1.2fr;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.pc-field-group {
  display: flex;
  flex-direction: column;
}

.pc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.pc-field-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.pc-btn-detect-ip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.pc-btn-detect-ip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.pc-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  animation: pcPulse 1.8s infinite;
}

@keyframes pcPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.pc-input-wrapper input,
.pc-input-wrapper select {
  width: 100%;
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pc-input-wrapper input:focus,
.pc-input-wrapper select:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pc-input-hint {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.pc-btn-check {
  height: 44px;
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.pc-btn-check:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.pc-btn-check:active {
  transform: translateY(0);
}

.pc-btn-check:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Presets Bar */
.pc-presets-section {
  margin-top: 1.5rem;
}

.pc-presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.pc-presets-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.pc-presets-search-wrap input {
  padding: 0.45rem 0.85rem;
  font-size: 0.86rem;
  width: 280px;
  max-width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
}

.pc-presets-search-wrap input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
}

.pc-cat-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pc-cat-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pc-cat-pill:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.pc-cat-pill.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.pc-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
  max-height: 270px;
  overflow-y: auto;
  padding: 0.35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.pc-preset-chip {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.pc-preset-chip:hover {
  border-color: #2563eb;
  background: #f0f7ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.08);
}

.pc-preset-chip.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px #2563eb;
}

.pc-preset-chip-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.pc-preset-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-preset-port-badge {
  font-size: 0.74rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
}

.pc-preset-chip.active .pc-preset-port-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.pc-preset-proto {
  font-size: 0.72rem;
  color: #64748b;
}

/* Selected Preset Banner */
.pc-selected-banner {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  animation: pcFadeIn 0.2s ease;
}

.pc-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-banner-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.pc-banner-title strong {
  font-size: 1rem;
  color: #0f172a;
}

.pc-badge-port {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.pc-badge-risk {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.pc-badge-risk.low { background: #dcfce7; color: #166534; }
.pc-badge-risk.moderate { background: #fef3c7; color: #92400e; }
.pc-badge-risk.high { background: #fee2e2; color: #991b1b; }
.pc-badge-risk.critical { background: #450a0a; color: #fecaca; }

.pc-btn-dismiss {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #94a3b8;
  cursor: pointer;
}

.pc-btn-dismiss:hover { color: #475569; }

.pc-banner-desc {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.88rem;
  color: #334155;
}

.pc-banner-advisory {
  font-size: 0.84rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border-left: 3px solid #64748b;
  margin-top: 0.5rem;
}

/* Diagnostic HUD & Terminal */
.pc-diagnostic-hud {
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  animation: pcFadeIn 0.25s ease;
}

@keyframes pcFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pc-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: #0f172a;
  color: #ffffff;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pc-hud-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pc-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
}

.pc-status-dot.open {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.pc-status-dot.closed {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.pc-status-dot.filtered {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.pc-status-dot.probing {
  background: #3b82f6;
  animation: pcPulse 1s infinite;
}

.pc-status-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pc-hud-meta {
  display: flex;
  gap: 0.5rem;
}

.pc-meta-pill {
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  color: #e2e8f0;
}

.pc-verdict-card {
  padding: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pc-verdict-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: #0f172a;
}

.pc-verdict-card p {
  margin: 0;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.5;
}

.pc-verdict-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.pc-terminal-window {
  background: #020617;
  color: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
}

.pc-terminal-titlebar {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #090d16;
  border-bottom: 1px solid #1e293b;
  gap: 0.45rem;
}

.pc-term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pc-term-dot.red { background: #ef4444; }
.pc-term-dot.yellow { background: #f59e0b; }
.pc-term-dot.green { background: #10b981; }

.pc-term-title {
  margin-left: 0.5rem;
  font-size: 0.76rem;
  color: #94a3b8;
  flex-grow: 1;
}

.pc-term-clear {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.pc-term-clear:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.pc-terminal-output {
  margin: 0;
  padding: 1rem 1.25rem;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #93c5fd;
}

/* Firewall Generator */
.pc-firewall-generator {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
}

.pc-fw-os-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.85rem;
}

.pc-fw-tab {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pc-fw-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pc-fw-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.pc-fw-code-wrapper {
  position: relative;
}

.pc-fw-code {
  margin: 0;
  padding: 1rem 1.25rem;
  background: #0f172a;
  color: #38bdf8;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.pc-btn-copy-code {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.pc-btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 900px) {
  .pc-config-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }
  .pc-action-group {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .pc-config-grid {
    grid-template-columns: 1fr;
  }
  .pc-action-group {
    grid-column: span 1;
  }
  .pc-presets-search-wrap input {
    width: 100%;
  }
  .port-checker-card {
    padding: 1.15rem;
  }
}


/* ==========================================================================
   Tool #4: Carrier-Grade NAT (CGNAT) & Double NAT Diagnostic Engine
   ========================================================================== */
.cgnat-tool-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

.cgnat-privacy-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  font-size: 0.84rem;
  color: #166534;
  margin-bottom: 1.25rem;
}

.cgnat-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.cgnat-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cgnat-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cgnat-label-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.cgnat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.cgnat-text-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.cgnat-text-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cgnat-input-btn {
  position: absolute;
  right: 6px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.cgnat-input-btn:hover {
  background: #1d4ed8;
}

.cgnat-presets-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.cgnat-presets-label {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 600;
}

.cgnat-preset-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  color: #334155;
  font-family: ui-monospace, monospace;
  cursor: pointer;
  transition: all 0.1s ease;
}

.cgnat-preset-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

.cgnat-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cgnat-primary-btn {
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cgnat-primary-btn:hover {
  background: #1d4ed8;
}

.cgnat-secondary-btn {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
}

.cgnat-secondary-btn:hover {
  background: #f1f5f9;
}

/* Verdict HUD Card */
.cgnat-verdict-card {
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 6px solid;
  animation: fadeIn 0.25s ease-out;
}

.cgnat-verdict-card.critical {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.cgnat-verdict-card.warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.cgnat-verdict-card.success {
  background: #f0fdf4;
  border-color: #10b981;
  color: #166534;
}

.cgnat-verdict-card.danger {
  background: #fef2f2;
  border-color: #b91c1c;
  color: #7f1d1d;
}

.cgnat-verdict-card.neutral {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #334155;
}

.verdict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.verdict-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.verdict-badge.critical { background: #fee2e2; color: #b91c1c; }
.verdict-badge.warning { background: #fef3c7; color: #b45309; }
.verdict-badge.success { background: #dcfce7; color: #15803d; }

.verdict-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

.verdict-body p {
  margin: 0.4rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.verdict-port-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.verdict-port-badge.blocked { background: #fee2e2; color: #991b1b; }
.verdict-port-badge.open { background: #dcfce7; color: #166534; }

/* SVG Topology Card */
.cgnat-svg-card {
  background: #0f172a;
  border-radius: 14px;
  padding: 1.25rem;
  color: #f8fafc;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

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

.svg-badge {
  background: #1e293b;
  color: #38bdf8;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.svg-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-item .dot-clean { background: #10b981; }
.legend-item .dot-break { background: #ef4444; }

.svg-viewport-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.svg-viewport-wrapper svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

/* SVG Topology Styling */
.topo-cable {
  stroke: #334155;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke 0.3s ease;
}

.topo-cable.cable-active { stroke: #10b981; }
.topo-cable.cable-break { stroke: #ef4444; stroke-dasharray: 6 4; }

.topo-packet {
  fill: #38bdf8;
  animation: packetFlow 2.4s infinite linear;
}

@keyframes packetFlow {
  0% { opacity: 0; transform: translateX(0); }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(80px); }
}

.topo-node-group {
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease;
}

.topo-node-group:hover, .topo-node-group:focus-visible {
  transform: translateY(-2px);
}

.node-box {
  fill: #1e293b;
  stroke: #334155;
  stroke-width: 1.5;
  transition: all 0.25s ease;
}

.topo-node-group.active-danger .node-box {
  stroke: #ef4444;
  stroke-width: 2.5;
  fill: #2a1215;
  filter: url(#glow-danger);
}

.topo-node-group.active-success .node-box {
  stroke: #10b981;
  stroke-width: 2.5;
  fill: #062b1b;
}

.node-pill-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 9px;
  font-weight: 800;
  fill: #475569;
  letter-spacing: 0.5px;
}

.node-icon { font-size: 26px; }

.node-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 750;
  fill: #ffffff;
}

.node-meta, .node-sublabel {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  fill: #94a3b8;
}

.ip-badge-bg { fill: #0f172a; }
.ip-badge-bg.small { fill: #09101d; }

.ip-badge-text {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  fill: #38bdf8;
}

.ip-badge-text.bold { font-weight: 700; }
.ip-badge-text.small { font-size: 9.5px; }

.cable-tag {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 600;
  fill: #64748b;
}

.node-status-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 9.5px;
  font-weight: 800;
}

.break-ring-pulse {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2;
  opacity: 0.7;
  animation: pulseBreak 1.6s infinite ease-out;
}

@keyframes pulseBreak {
  0% { r: 12px; opacity: 1; }
  100% { r: 30px; opacity: 0; }
}

/* Hop Detail Inspector Drawer */
.cgnat-hop-inspector {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-top: 1rem;
}

.inspector-badge {
  display: inline-block;
  background: #334155;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #334155;
}

.insp-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.insp-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.insp-cell strong {
  font-size: 0.85rem;
  color: #f8fafc;
  font-family: ui-monospace, monospace;
}

/* Bypass Blueprints Section */
.cgnat-blueprints-section {
  margin: 2.5rem 0;
}

.blueprint-badge {
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.blueprint-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin: 1.15rem 0 0.85rem;
}

.bp-tab {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.bp-tab:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.bp-tab.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.bp-icon { font-size: 1.4rem; }

.bp-text strong {
  display: block;
  font-size: 0.86rem;
  color: #0f172a;
}

.bp-text small {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
}

.blueprint-content-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.bp-lead h4 {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
  color: #0f172a;
}

.bp-lead p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
}

.bp-steps ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: #334155;
}

.bp-steps li { margin: 0.4rem 0; }

.bp-code-wrapper {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}

.bp-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.95rem;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
}

.bp-copy-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s ease;
}

.bp-copy-btn:hover { background: #475569; }

.bp-code-wrapper pre {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
}

.bp-code-wrapper code {
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

@media (max-width: 768px) {
  .cgnat-controls-grid { grid-template-columns: 1fr; }
  .blueprint-tabs { grid-template-columns: 1fr 1fr; }
  .inspector-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .blueprint-tabs { grid-template-columns: 1fr; }
  .cgnat-btn-row { flex-direction: column; }
}


/* ==========================================================================
   Router Portal: Typo Disambiguation HUD, Cellular Callout & Fallback Matrix
   Day 4: Panic Typo & Hardware Outage Domination
   Zero external dependencies · 100% WCAG 2.1 AA Compliant · High-Contrast
   ========================================================================== */

/* --- 1. Visual Typo Disambiguation HUD --- */
.typo-disambiguation-hud {
  margin: 24px 0 30px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line, #d8e1ed);
  box-shadow: 0 8px 24px rgba(26, 52, 92, 0.06);
  overflow: hidden;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #0f1f38;
  color: #ffffff;
}

.hud-header h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #dce8fb;
}

.hud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.hud-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-card-invalid {
  background: #fff8f8;
  border-right: 1px solid #fecaca;
}

.hud-card-valid {
  background: #f0fdf4;
}

.hud-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hud-card-invalid .hud-card-label {
  color: #b91c1c;
}

.hud-card-valid .hud-card-label {
  color: #15803d;
}

.hud-code-display {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.hud-card-invalid .hud-code-display {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

.hud-card-valid .hud-code-display {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #4ade80;
}

.hud-token-bad {
  background: #ef4444;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: underline wavy #ffffff;
  font-weight: 900;
}

.hud-token-good {
  background: #22c55e;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 900;
}

.hud-badge-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.hud-card-invalid .hud-badge-pill {
  background: #fca5a5;
  color: #7f1d1d;
}

.hud-card-valid .hud-badge-pill {
  background: #86efac;
  color: #14532d;
}

.hud-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink, #17253d);
  margin: 0 0 16px;
}

.hud-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.hud-card-actions .button {
  min-height: 40px;
  padding: 9px 15px;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .hud-grid {
    grid-template-columns: 1fr;
  }
  .hud-card-invalid {
    border-right: none;
    border-bottom: 1px solid #fecaca;
  }
}

/* --- 2. Prominent Cellular Data Disconnect Callout --- */
.cellular-disconnect-callout {
  margin: 26px 0;
  border: 2px solid #f59e0b;
  border-radius: 16px;
  background: #fffbeb;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.12);
  overflow: hidden;
}

.cell-callout-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #d97706;
  color: #ffffff;
  padding: 14px 20px;
}

.cell-callout-header svg {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.cell-callout-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cell-callout-body {
  padding: 20px;
  color: #451a03;
}

.cell-callout-body p {
  font-size: 0.94rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.cell-tech-cause {
  background: rgba(245, 158, 11, 0.15);
  border-left: 4px solid #d97706;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.cell-platforms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cell-platform-box {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.cell-platform-box h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #92400e;
}

.cell-platform-box ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #3f4f6c;
}

.cell-platform-box li {
  margin-bottom: 6px;
}

.cell-platform-box li:last-child {
  margin-bottom: 0;
}

@media (max-width: 680px) {
  .cell-platforms-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 3. 1-Click Direct Numerical IP Fallback Matrix --- */
.ip-fallback-matrix {
  margin: 28px 0;
  border: 1px solid var(--line, #d8e1ed);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(26, 52, 92, 0.06);
  padding: 22px;
}

.ip-fallback-matrix h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.matrix-lead {
  color: var(--muted, #60708c);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 18px;
}

.matrix-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line, #d8e1ed);
  border-radius: 12px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  background: #ffffff;
}

.matrix-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.matrix-table tr:last-child td {
  border-bottom: none;
}

.matrix-table tr:hover {
  background: #f8fafc;
}

.matrix-domain-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.matrix-ip-target {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  font-weight: 800;
  color: #15803d;
}

.matrix-btn-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.matrix-btn-cell .button {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 0.78rem;
}

.matrix-notice-card {
  margin-top: 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.5;
}

.matrix-notice-card strong {
  color: #0f172a;
}


/* ==========================================================================
   Day 5: Cryptographic DNS Leak Inspector & Automated Gateway Prober
   100% Client-Side · Zero External Dependencies · Mobile-Responsive · WCAG 2.1 AA
   ========================================================================== */

/* --- DNS Leak Inspector Styles --- */
.dns-leak-tool-shell {
  margin: 28px 0 34px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line, #d8e1ed);
  box-shadow: 0 10px 30px rgba(26, 52, 92, 0.08);
  overflow: hidden;
}

.dns-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: #0f1f38;
  color: #ffffff;
}

.dns-tool-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dns-engine-body {
  padding: 24px;
}

.dns-action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.dns-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff !important;
  font-weight: 750;
  font-size: 0.96rem;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dns-btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.dns-btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.dns-progress-container {
  display: none;
  margin-bottom: 22px;
}

.dns-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dns-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.dns-progress-status {
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

.dns-verdict-card {
  display: none;
  padding: 18px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.55;
  border: 1px solid transparent;
}

.dns-verdict-card.verdict-secure {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.dns-verdict-card.verdict-leak {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.dns-verdict-card.verdict-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.dns-verdict-card h4 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dns-resolvers-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #d8e1ed);
  border-radius: 12px;
  margin-bottom: 20px;
}

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

.dns-resolvers-table th {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 1px solid #cbd5e1;
}

.dns-resolvers-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.dns-resolvers-table tr:last-child td {
  border-bottom: none;
}

.dns-proto-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 3px 7px;
  border-radius: 5px;
}

.dns-proto-badge.proto-doh { background: #dcfce7; color: #166534; }
.dns-proto-badge.proto-dot { background: #e0e7ff; color: #3730a3; }
.dns-proto-badge.proto-udp { background: #fee2e2; color: #991b1b; }

/* --- Gateway Prober & Radar Styles --- */
.gateway-prober-shell {
  margin: 28px 0 34px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line, #d8e1ed);
  box-shadow: 0 10px 30px rgba(26, 52, 92, 0.08);
  overflow: hidden;
}

.prober-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: #0b1528;
  color: #ffffff;
}

.prober-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prober-body {
  padding: 24px;
}

.radar-console {
  background: #09101d;
  border: 1px solid #1e3a5f;
  border-radius: 14px;
  padding: 20px;
  color: #93c5fd;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.radar-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: #60a5fa;
  border-bottom: 1px solid #1e3a5f;
  padding-bottom: 10px;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.radar-node {
  background: rgba(30, 58, 95, 0.4);
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: #cbd5e1;
  transition: all 0.25s ease;
}

.radar-node.probing {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.radar-node.found {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
  transform: scale(1.04);
}

.radar-node.timeout {
  border-color: #334155;
  color: #475569;
  opacity: 0.5;
}

.prober-result-card {
  display: none;
  background: #f0fdf4;
  border: 2px solid #22c55e;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
}

.prober-result-card h4 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detected-ip-hero {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 900;
  color: #14532d;
  margin: 10px 0 16px;
}

/* --- Terminal Command Tabs --- */
.terminal-simulator {
  margin: 24px 0;
  border-radius: 14px;
  background: #0f172a;
  color: #f8fafc;
  overflow: hidden;
  border: 1px solid #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }

.terminal-os-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.terminal-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.terminal-tab-btn.active {
  background: #0f172a;
  color: #38bdf8;
  border-color: #334155;
}

.terminal-body {
  padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}

.terminal-cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 10px 0 14px;
}

.terminal-cmd-code {
  color: #38bdf8;
  word-break: break-all;
}

.terminal-copy-btn {
  background: #334155;
  color: #f1f5f9;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.terminal-copy-btn:hover {
  background: #475569;
}

/* ==========================================================================
   DAY 6: REGIONAL SEARCH MONOPOLY BLITZ (BANGLADESH & SOUTH ASIA)
   Optical Power Meter, BDIX Clamping & GPON ONU Diagnostics
   ========================================================================== */

.optical-meter-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 22px;
  margin: 24px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.optical-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.optical-meter-header h3 {
  margin: 0;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.optical-gauge-container {
  margin: 18px 0;
}

.optical-meter-track {
  width: 100%;
  height: 14px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid #cbd5e1;
}

.optical-meter-fill {
  height: 100%;
  width: 50%;
  background: #22c55e;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 10px;
}

.optical-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.optical-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.optical-slider {
  flex: 1;
  min-width: 180px;
  accent-color: #2563eb;
  height: 6px;
  cursor: pointer;
}

.optical-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.optical-input-wrap input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  text-align: center;
}

.optical-advice-box {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #1e293b;
}

/* BDIX Clamping Styles */
.bdix-clamping-card {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 22px;
  margin: 24px 0;
}

.bdix-clamping-card h3 {
  margin: 0 0 12px;
  color: #38bdf8;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bdix-grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.bdix-metric-tile {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.bdix-metric-tile small {
  display: block;
  color: #94a3b8;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.bdix-metric-tile strong {
  font-size: 1.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #22c55e;
}

.bdix-code-block {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  position: relative;
}

.bdix-code-block code {
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  display: block;
  padding-right: 80px;
}

.bdix-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.bdix-copy-btn:hover {
  background: #475569;
}

/* ==========================================================================
   DAY 7: VIRAL RETENTION LEVERS, STICKY DRAWER & PRINTABLE VAULT
   ========================================================================== */

/* 1. Sticky Mobile Gateway Quick-Test Drawer */
.rp-sticky-drawer {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  z-index: 995;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #334155;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  color: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 769px) {
  .rp-sticky-drawer {
    bottom: 0;
    left: auto;
    right: 24px;
    width: 380px;
    border-radius: 12px 12px 0 0;
    border-left: 1px solid #334155;
    border-right: 1px solid #334155;
  }
}

.rp-drawer-inner {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rp-drawer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.rp-drawer-info code {
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 0.92rem;
}

.rp-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rp-drawer-btn {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease;
}

.rp-drawer-btn:hover {
  background: #334155;
}

.rp-drawer-btn.primary {
  background: #2563eb;
  border-color: #3b82f6;
}

.rp-drawer-btn.primary:hover {
  background: #1d4ed8;
}

.rp-drawer-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px 6px;
  cursor: pointer;
}

.rp-sticky-drawer.minimized {
  transform: translateY(calc(100% - 24px));
}

@media (min-width: 769px) {
  .rp-sticky-drawer.minimized {
    transform: translateY(calc(100% - 28px));
  }
}

.rp-drawer-tab-handle {
  height: 6px;
  width: 40px;
  background: #475569;
  border-radius: 3px;
  margin: 4px auto 2px;
}

/* 2. Interactive 3-Tier Network Decision Tree */
.decision-tree-container {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.triage-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.triage-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: all 0.2s ease;
}

.triage-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.triage-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.triage-panel-body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 14px;
  display: none;
}

.triage-panel-body h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #0f172a;
}

/* 3. Save My Network Vault */
.network-vault-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  margin: 24px 0;
}

.vault-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.vault-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.vault-field input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}

/* 4. Printable Emergency Router Cheat Sheet */
#printable-cheat-sheet {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  #printable-cheat-sheet, #printable-cheat-sheet * {
    visibility: visible;
  }
  #printable-cheat-sheet {
    display: block !important;
    position: absolute;
    left: 20px;
    top: 20px;
    width: 480px;
    border: 2px dashed #0f172a;
    border-radius: 12px;
    padding: 24px;
    font-family: system-ui, -apple-system, sans-serif;
    color: #000000;
    background: #ffffff;
    box-sizing: border-box;
  }
  .site-header, .site-footer, .bottom-nav, .rp-sticky-drawer, .skip-link, .portal-topbar {
    display: none !important;
  }
}
