/* SINGLE POST & TOPIC STYLES */
.single-post-container {
  --blue: #2563eb; --blue-dark: #1d4ed8; --text-dark: #0f172a; --text-body: #334155;
  --text-muted: #64748b; --border: #e5e7eb; --bg-soft: #f8fafc; --purple-soft: #eef2ff;
  --purple-border: #e0e7ff; --red: #ef4444; --green: #16a34a; --radius: 12px;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  color: var(--text-dark); background: #ffffff; line-height: 1.5;
}

.single-post-container a { color: inherit; text-decoration: none; }
.single-post-container ul { list-style: none; padding: 0; margin: 0; }
.single-post-container button { font-family: inherit; cursor: pointer; }

.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg,var(--blue),#818cf8); z-index: 60; transition: width .1s linear; }

.app-topbar { display: none; align-items: center; justify-content: space-between; padding: 12px 20px; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; color: var(--text-dark); flex-shrink: 0; position: relative; transition: background .15s ease, border-color .15s ease; }
.topbar-btn:hover { background: var(--bg-soft); border-color: #cbd5e1; }
.topbar-btn svg { width: 19px; height: 19px; }
.topbar-brand { font-size: 14.5px; font-weight: 800; color: var(--text-dark); letter-spacing: -.01em; }
.topbar-dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 1.5px solid #fff; }

.page { max-width: 1240px; margin: 0 auto; padding: 24px 24px 64px; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--blue); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb svg { width: 12px; height: 12px; color: #94a3b8; }

/* Layout */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }

/* Main article */
.badge-category { display: inline-block; background: var(--purple-soft); color: #4f46e5; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 5px 10px; border-radius: 6px; margin-bottom: 14px; text-transform: uppercase; }
h1.title { font-size: 32px; line-height: 1.25; font-weight: 800; color: var(--text-dark); margin-bottom: 14px; letter-spacing: -.01em; }
p.dek { font-size: 16px; color: var(--text-body); margin-bottom: 20px; }

.byline { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.byline-left { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--text-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.byline-name { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; }
.byline-name svg { width: 15px; height: 15px; flex-shrink: 0; }
.byline-meta { font-size: 12.5px; color: var(--text-muted); }

.byline-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text-dark); transition: background .15s ease, border-color .15s ease; }
.icon-btn:hover { background: var(--bg-soft); border-color: #cbd5e1; }
.icon-btn.square { padding: 8px; }
.icon-btn svg.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Dynamic Body & Typography */
.post-dynamic-body { font-size: 16px; line-height: 1.7; color: var(--text-body); }
.post-dynamic-body p { margin-bottom: 18px; }
.post-dynamic-body h2 { font-size: 22px; font-weight: 800; color: var(--text-dark); margin: 28px 0 14px; }
.post-dynamic-body h3 { font-size: 18px; font-weight: 700; color: var(--text-dark); margin: 24px 0 12px; }
.post-dynamic-body ul, .post-dynamic-body ol { margin-bottom: 18px; padding-left: 20px; }
.post-dynamic-body li { margin-bottom: 8px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 20px; }
.side-card { border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; background: #fff; box-shadow: 0 2px 10px -6px rgba(15,23,42,.08); }
.side-card h5 { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; }
.toc { display: flex; flex-direction: column; gap: 11px; }
.toc a { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-body); font-weight: 500; }
.toc a:hover { color: var(--blue); }
.toc-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }

.promo-card { border-radius: 18px; padding: 22px 20px; background: linear-gradient(155deg,#312e81 0%, #4338ca 55%, #6366f1 100%); position: relative; overflow: hidden; box-shadow: 0 10px 26px -12px rgba(67,56,202,.5); }
.promo-card::before { content: ""; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.08); }
.promo-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.16); color: #fde68a; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 5px 10px; border-radius: 999px; margin-bottom: 12px; }
.promo-badge svg { width: 11px; height: 11px; }
.promo-card h5 { color: #fff; font-size: 16.5px; font-weight: 800; margin-bottom: 14px; line-height: 1.35; text-transform: none; letter-spacing: 0; }
.promo-features { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; position: relative; z-index: 1; }
.promo-features div { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.92); font-size: 13px; font-weight: 600; }
.promo-features svg { width: 16px; height: 16px; color: #4ade80; flex-shrink: 0; }
.promo-rating { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75); font-size: 11.5px; font-weight: 600; margin-bottom: 14px; }
.promo-rating span.stars { color: #fbbf24; letter-spacing: 1px; }
.btn-promo { width: 100%; background: #fff; color: #4338ca; border: none; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 14px -4px rgba(0,0,0,.25); }
.btn-promo:hover { background: #f5f5ff; }
.btn-promo svg { width: 17px; height: 17px; }

.pdf-card { display: flex; gap: 14px; align-items: flex-start; }
.pdf-icon { width: 42px; height: 42px; border-radius: 10px; background: #fee2e2; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pdf-icon svg.icon { width: 20px; height: 20px; color: var(--red); }
.pdf-card h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 3px; }
.pdf-card p { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.btn-dark { width: 100%; background: var(--text-dark); color: #fff; border: none; border-radius: 8px; padding: 11px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-dark:hover { background: #1e293b; }
.btn-dark svg { width: 15px; height: 15px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text-dark); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 13.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 15px; height: 15px; color: #4ade80; }

.mobile-bar { display: none; }

@media (max-width: 640px) {
  .app-topbar { display: flex; position: sticky; top: 0; z-index: 59; }
  .page { padding: 16px 16px 100px; }
  h1.title { font-size: 23px; line-height: 1.3; }
  p.dek { font-size: 14.5px; }
  .byline-actions .icon-btn span { display: none; }
  .icon-btn { padding: 8px 10px; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--border); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); justify-content: space-between; align-items: center; gap: 6px; box-shadow: 0 -6px 20px -12px rgba(15,23,42,.25); }
  .mobile-bar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--text-muted); font-size: 10.5px; font-weight: 600; padding: 6px 4px; border-radius: 10px; }
  .mobile-bar button.active, .mobile-bar button:active { color: var(--blue); background: var(--purple-soft); }
  .mobile-bar svg { width: 20px; height: 20px; }
  .mobile-bar .mb-primary { background: var(--blue); color: #fff; border-radius: 12px; }
  .mobile-bar .mb-primary:active { background: var(--blue-dark); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}