/* ProCodex Legal Knowledge Base / Articles Stylesheet */
:root {
  --ink: #262626;
  --ink-deep: #161616;
  --muted: #555555;
  --soft-muted: #737373;
  --bg-soft: #f8f9fa;
  --bg-card: #ffffff;
  --line: #e5e7eb;
  --line-light: #f0f0f0;
  --accent: #262626;
  --accent-hover: #404040;
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.kb-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.kb-header-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kb-logo {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.kb-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--soft-muted);
  padding: 3px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.kb-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.kb-nav-link {
  color: var(--muted);
  transition: color 0.15s;
}

.kb-nav-link:hover {
  color: var(--ink);
}

.kb-service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--ink);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.15s;
}

.kb-service-link:hover {
  background: var(--accent-hover);
}

/* Main Container */
.kb-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

.kb-container-wide {
  max-width: 1060px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Breadcrumbs */
.kb-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--soft-muted);
  margin-bottom: 24px;
}

.kb-breadcrumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kb-breadcrumbs span.sep {
  color: #c0c0c0;
}

/* Article Header */
.article-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--soft-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-cat-pill {
  display: inline-block;
  padding: 3px 10px;
  background: #f1f3f5;
  border-radius: 4px;
  color: #333;
  font-weight: 500;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s;
}

.article-cat-pill:hover {
  background: #e4e7eb;
}

.article-header h1 {
  font-size: clamp(26px, 3.8vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink-deep);
  margin: 0;
}

/* Article Body Typography */
.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

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

.article-body h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink-deep);
  margin: 2.2rem 0 1rem;
}

.article-body h3 {
  font-size: 19px;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ink-deep);
  margin: 1.8rem 0 0.8rem;
}

.article-body h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.4rem;
  padding-left: 28px;
}

.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.article-body blockquote {
  margin: 1.6rem 0;
  padding: 14px 20px;
  background: var(--bg-soft);
  border-left: 3px solid var(--ink);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #3f3f3f;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body a {
  color: #1a56db;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.article-body a:hover {
  color: #1e429f;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 24px auto;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.article-body figure {
  margin: 24px 0;
  text-align: center;
}

.article-body figcaption {
  font-size: 13px;
  color: var(--soft-muted);
  margin-top: 8px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.article-body th,
.article-body td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.article-body th {
  background: var(--bg-soft);
  font-weight: 600;
}

/* Service Promo / Ad Card */
.service-promo-card {
  margin: 48px 0 36px;
  background: #fbfbfb;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.promo-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #e2e8f0;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.promo-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
  margin: 0 0 10px;
}

.promo-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}

.promo-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.promo-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.promo-action {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.promo-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--ink);
  color: #fff !important;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s;
}

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

.promo-button span {
  font-size: 16px;
  transition: transform 0.15s;
}

.promo-button:hover span {
  transform: translateX(3px);
}

.promo-subtext {
  font-size: 12px;
  color: #718096;
}

/* Related Articles */
.related-box {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.related-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.related-card {
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s, background 0.15s;
}

.related-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.related-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 8px;
}

.related-card-date {
  font-size: 12px;
  color: var(--soft-muted);
}

/* Catalog / Hub Styles */
.catalog-hero {
  margin-bottom: 36px;
  text-align: center;
}

.catalog-title {
  font-size: clamp(30px, 4.2vw, 44px);
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 12px;
}

.catalog-subtitle {
  font-size: 17px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Search bar */
.catalog-search-wrap {
  max-width: 520px;
  margin: 0 auto 30px;
  position: relative;
}

.catalog-search-input {
  width: 100%;
  padding: 13px 18px 13px 42px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.catalog-search-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(38, 38, 38, 0.08);
}

.catalog-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* Category Filters */
.cat-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}

.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-btn:hover {
  border-color: #94a3b8;
  color: var(--ink);
}

.cat-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.cat-btn-count {
  font-size: 11px;
  opacity: 0.75;
}

/* Article Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.article-item-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.article-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.item-top {
  margin-bottom: 12px;
}

.item-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.item-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink-deep);
  line-height: 1.4;
  margin: 0 0 10px;
}

.item-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--soft-muted);
}

.item-read-link {
  color: var(--ink);
  font-weight: 500;
}

/* Footer */
.kb-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 36px 20px;
  margin-top: 60px;
  font-size: 13px;
  color: var(--soft-muted);
}

.kb-footer-wrap {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.kb-footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.kb-footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .kb-header-wrap {
    height: 58px;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .promo-action {
    flex-direction: column;
    align-items: flex-start;
  }
  .promo-button {
    width: 100%;
    justify-content: center;
  }
  .kb-footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Inline Lead Banner & Visual Diagram Components
   ========================================================================== */
.inline-promo-box {
  margin: 32px 0;
  padding: 20px 24px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.inline-promo-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.inline-promo-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  margin-top: 2px;
}

.inline-promo-text strong {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-deep);
  margin-bottom: 4px;
}

.inline-promo-text p {
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: var(--muted) !important;
  margin: 0 !important;
}

.inline-promo-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff !important;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s;
}

.inline-promo-btn:hover {
  background: var(--accent-hover);
}

@media (max-width: 768px) {
  .inline-promo-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
  }
  .inline-promo-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Visual Schemes and Diagrams */
.diagram-box {
  margin: 32px 0;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.diagram-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  margin: 0;
}

.diagram-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Step Flow */
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.step-card {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  position: relative;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-deep);
  margin-bottom: 6px;
  line-height: 1.35;
}

.step-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Risk Matrix */
.risk-matrix {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-item {
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.risk-item.low {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
}

.risk-item.med {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
}

.risk-item.high {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
}

.risk-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.risk-item.low .risk-label { color: #15803d; }
.risk-item.med .risk-label { color: #b45309; }
.risk-item.high .risk-label { color: #b91c1c; }

.risk-text {
  color: #374151;
  font-size: 13px;
  margin: 0;
}

/* Comparison Table / Cards */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-card {
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.compare-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.compare-card.positive {
  border-top: 3px solid #16a34a;
}

.compare-card.warning {
  border-top: 3px solid #ea580c;
}

.compare-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.compare-list li {
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 640px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

/* Action Notice Callout */
.notice-callout {
  margin: 24px 0;
  padding: 16px 20px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 0 8px 8px 0;
}

.notice-callout-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e40af;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-callout-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: #1e3a8a;
  margin: 0;
}

/* PC-Info Custom Editorial Visual Blocks */
.pc-info {
  --pc-ink: #1d2939;
  --pc-muted: #667085;
  --pc-line: #e4e7ec;
  --pc-bg: #f8fafc;
  --pc-blue: #2563eb;
  font-family: inherit;
  color: var(--pc-ink);
  margin: 32px 0;
}

.pc-info * {
  box-sizing: border-box;
}

.pc-info__heading {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin: 0 0 16px;
  color: #111827;
}

.pc-info__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pc-info__card {
  background: var(--pc-bg);
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}

.pc-info__card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #111827;
}

.pc-info__card p,
.pc-info__card li {
  font-size: 14px;
  line-height: 1.6;
}

.pc-info__card p {
  margin: 0 0 12px;
}

.pc-info__card a {
  color: var(--pc-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.pc-info__links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.pc-info__step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--pc-line);
}

.pc-info__step:last-child {
  border: 0;
}

.pc-info__number {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.pc-info__step strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 4px;
  color: #111827;
}

.pc-info__step p {
  color: var(--pc-muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

.pc-info__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pc-info__branch {
  border: 1px solid var(--pc-line);
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.pc-info__branch strong {
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
  color: #111827;
}

.pc-info__branch p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--pc-muted);
}

.pc-info__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
}

.pc-info__table th,
.pc-info__table td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--pc-line);
}

.pc-info__table th {
  color: var(--pc-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pc-info__table tbody tr:last-child td {
  border-bottom: 0;
}

.pc-info__note {
  border-left: 3px solid var(--pc-blue);
  padding: 8px 0 8px 14px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--pc-muted);
}

@media (max-width: 600px) {
  .pc-info__grid,
  .pc-info__split {
    grid-template-columns: 1fr;
  }
  .pc-info__heading {
    font-size: 18px;
  }
  .pc-info__card {
    padding: 16px;
  }
}

