/* ==========================================================================
   v8profi.ru — Портал новостей 1С:Предприятие
   Современные стили, адаптивный дизайн, темная и светлая темы
   ========================================================================== */

:root {
  --primary-color: #f59e0b;
  --primary-hover: #d97706;
  --primary-light: #fef3c7;
  --primary-1c-yellow: #fdb813;
  --primary-1c-red: #e52e2d;
  
  --bg-color: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #f59e0b;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;

  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  
  --header-bg: #0f172a;
  --header-text: #f8fafc;
  --header-border: #1e293b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s ease-in-out;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

[data-theme="dark"] {
  --bg-color: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-elevated: #1a243b;
  --bg-subtle: #192238;
  --border-color: #263352;
  --border-focus: #f59e0b;
  
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --code-bg: #090d16;
  --code-text: #e2e8f0;
  
  --header-bg: #070a12;
  --header-text: #f8fafc;
  --header-border: #1a243b;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);
}

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

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-color);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

img, svg {
  vertical-align: middle;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header & Live Ticker
   ========================================================================== */
.live-ticker-bar {
  background: #090d16;
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e293b;
}

.ticker-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow-x: auto;
  white-space: nowrap;
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--primary-1c-yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.ticker-dot {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.ticker-items {
  display: flex;
  gap: 1.5rem;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ticker-item strong {
  color: #f1f5f9;
}

/* Main Header */
.main-header {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1.5rem;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-1c-yellow);
  color: #111827;
  font-weight: 900;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(253, 184, 19, 0.4);
  position: relative;
  overflow: hidden;
}

.logo-badge::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: var(--primary-1c-red);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.logo-domain {
  color: var(--primary-1c-yellow);
}

.logo-tagline {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

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

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.4rem;
  border-radius: var(--radius-full);
  border: 1px solid #334155;
  background: #1e293b;
  color: #f8fafc;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-color);
  background: #172033;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  color: #94a3b8;
  padding: 0.2rem;
  display: none;
}

.search-clear-btn:hover {
  color: #ffffff;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #334155;
  transition: var(--transition);
  position: relative;
}

.btn-icon:hover {
  color: #ffffff;
  background: #27354f;
  border-color: #475569;
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary-1c-red);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--header-bg);
}

/* ==========================================================================
   Navigation Bar (Categories & Tags)
   ========================================================================== */
.category-nav-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0;
  position: sticky;
  top: 70px;
  z-index: 90;
  transition: background-color 0.2s;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.2rem 0;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--border-color);
}

.tab-btn.active {
  background: var(--primary-1c-yellow);
  color: #111827;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(253, 184, 19, 0.35);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  flex: 1;
  padding: 2rem 0 3rem;
}

.page-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

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

/* Active filter state info */
.filter-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.filter-info-bar .btn-reset {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
  padding: 0.2rem 0.5rem;
}

/* ==========================================================================
   Featured Hero Article Card
   ========================================================================== */
.featured-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  transition: var(--transition);
}

.featured-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.featured-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
}

.featured-banner::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(253, 184, 19, 0.25) 0%, rgba(253, 184, 19, 0) 70%);
  pointer-events: none;
}

.badge-featured {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-1c-red);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.featured-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: color 0.2s;
}

.featured-title:hover {
  color: var(--primary-1c-yellow);
}

.featured-summary {
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.featured-footer {
  padding: 1.25rem 2.25rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.tag-pill:hover {
  background: var(--primary-light);
  color: #92400e;
  border-color: #fcd34d;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-1c-yellow);
  color: #111827;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(253, 184, 19, 0.3);
}

.btn-primary:hover {
  background: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

/* ==========================================================================
   Articles Grid & News Card
   ========================================================================== */
.section-heading-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

.news-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: #b45309;
}

[data-theme="dark"] .category-badge {
  background: #382811;
  color: #fbbf24;
}

.btn-bookmark {
  color: var(--text-muted);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-bookmark:hover {
  color: var(--primary-1c-yellow);
}

.btn-bookmark.bookmarked {
  color: var(--primary-1c-yellow);
}

.news-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.news-title:hover {
  color: var(--primary-color);
}

.news-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.85rem;
  transition: gap 0.2s;
}

.btn-read-more:hover {
  gap: 0.45rem;
  color: var(--primary-hover);
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.widget-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Releases Table Widget */
.releases-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.release-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.release-info {
  display: flex;
  flex-direction: column;
}

.release-name {
  font-weight: 600;
  color: var(--text-main);
}

.release-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.release-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.release-status.success {
  background: #dcfce7;
  color: #166534;
}
.release-status.warning {
  background: #fef9c3;
  color: #854d0e;
}
.release-status.info {
  background: #e0f2fe;
  color: #0369a1;
}
.release-status.secondary {
  background: #f1f5f9;
  color: #475569;
}

/* Interactive Poll Widget */
.poll-question {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.poll-option-btn {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.poll-option-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: var(--bg-subtle);
}

.poll-result-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--primary-light);
  opacity: 0.45;
  z-index: 1;
  transition: width 0.6s ease;
}

[data-theme="dark"] .poll-result-bar {
  background: #451a03;
  opacity: 0.5;
}

.poll-option-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poll-pct {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary-hover);
}

.poll-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* Telegram / Newsletter Widget */
.widget-newsletter {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border: none;
}

.widget-newsletter .widget-title {
  color: #ffffff;
}

.newsletter-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.newsletter-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
  background: #1e293b;
  color: #ffffff;
  outline: none;
}

.newsletter-input:focus {
  border-color: var(--primary-1c-yellow);
}

.newsletter-submit {
  width: 100%;
  padding: 0.65rem;
  background: var(--primary-1c-yellow);
  color: #111827;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.newsletter-submit:hover {
  background: #f59e0b;
}

/* Community Telegram Banner */
.telegram-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  background: #0088cc15;
  border: 1px solid #0088cc40;
  border-radius: var(--radius-md);
  color: #0088cc;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}

.telegram-banner:hover {
  background: #0088cc25;
}

/* ==========================================================================
   Native Modal Dialog (<dialog:modal>)
   Adheres to modern-web-guidance:
   - overscroll-behavior: contain
   - ::backdrop overflow: hidden + overscroll-behavior: contain
   - closedby="any"
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  max-width: 840px;
  width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  padding: 0;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}

/* Modal Inner */
.modal-header {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 1.25rem;
}

.modal-close-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.modal-body {
  padding: 1.75rem 2rem;
}

@media (max-width: 640px) {
  .modal-body {
    padding: 1.25rem 1rem;
  }
}

.modal-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.modal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content p.lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.65;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.75rem 0 0.85rem;
  color: var(--text-main);
}

.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--primary-1c-yellow);
  padding: 0.75rem 1.25rem;
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Code Snippets (BSL) */
.article-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 1.5rem 0;
  position: relative;
  border: 1px solid #334155;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-subtle);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Tables inside articles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

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

.data-table th {
  background: var(--bg-subtle);
  font-weight: 700;
}

/* Modal Actions (Likes, Bookmarks, Share) */
.modal-article-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

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

.btn-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}

.btn-action-pill:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.btn-action-pill.active {
  background: #fee2e2;
  color: #dc2626;
}

[data-theme="dark"] .btn-action-pill.active {
  background: #450a0a;
  color: #f87171;
}

/* Comments Section */
.comments-section {
  margin-top: 2rem;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  background: var(--bg-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.comment-form input, .comment-form textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  outline: none;
}

.comment-form textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-form input:focus, .comment-form textarea:focus {
  border-color: var(--primary-color);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.comment-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-left: 4px solid var(--primary-1c-yellow);
  animation: slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes slide-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
  background: #0f172a;
  color: #cbd5e1;
  border-top: 1px solid #1e293b;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

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

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

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

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--primary-1c-yellow);
}

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

.footer-disclaimer {
  max-width: 600px;
}

/* ==========================================================================
   1C Developer Services Section & Commercial Lead CTAs
   ========================================================================== */
.btn-cta-header {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-1c-yellow);
  color: #111827;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(253, 184, 19, 0.4);
}

.btn-cta-header:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

.services-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  color: #ffffff;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.services-banner::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(253, 184, 19, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

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

.services-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.services-subtitle {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 650px;
  line-height: 1.5;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.service-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
}

.service-card:hover {
  background: #1e293b;
  border-color: var(--primary-1c-yellow);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.service-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.service-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.5rem;
}

.service-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.service-action {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-1c-yellow);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* In-Article Organic Lead Box */
.in-article-cta {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary-1c-yellow);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

[data-theme="dark"] .in-article-cta {
  background: #192238;
  border-color: #263352;
}

.in-article-cta .cta-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.in-article-cta h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.in-article-cta p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

/* Expert Profile Card in Sidebar */
.expert-profile-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.expert-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.expert-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-1c-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.expert-info {
  display: flex;
  flex-direction: column;
}

.expert-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-main);
}

.expert-role {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 600;
}

.expert-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.expert-btn {
  width: 100%;
  margin-top: 0.25rem;
}

/* Lead Modal Styles */
.lead-modal-content {
  padding: 1.75rem 2rem;
}

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

@media (max-width: 600px) {
  .lead-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-field input, .form-field select, .form-field textarea {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.lead-disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.75rem;
}

/* ==========================================================================
   Breadcrumbs Navigation
   ========================================================================== */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0.55rem 0.95rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  line-height: 1.4;
}

.breadcrumbs-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.breadcrumbs-separator {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.8rem;
  user-select: none;
}

.breadcrumbs-current {
  color: var(--text-main);
  font-weight: 600;
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .breadcrumbs {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .breadcrumbs-item {
    gap: 0.35rem;
  }
  .breadcrumbs-current {
    max-width: 180px;
  }
}


