/* Blog + LMS (shared by marketing, app and admin layouts). Token-only, CSP-safe. */
.cm { display: flex; flex-direction: column; gap: 1.4rem; }
.cm-wrap { max-width: 1100px; margin-inline: auto; padding: 2.5rem clamp(18px, 4vw, 40px) 4rem; }
.cm-narrow { max-width: 760px; }
.cm-h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; font-family: var(--font-body); font-weight: 800; letter-spacing: -.01em; }
.cm-lead { margin: .5rem 0 0; color: var(--text-muted); font-size: 1.1rem; max-width: 60ch; }
.cm-muted { color: var(--text-muted); }
.cm-small { font-size: .88rem; }
.cm-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cm-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.cm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; color: inherit; text-decoration: none; }
a.cm-card:hover { border-color: var(--text); }
.cm-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.cm-card p { margin: 0; color: var(--text-muted); }
.cm-cover { height: 110px; border-radius: 12px; margin: -.2rem 0 .3rem; display: flex; align-items: flex-end; padding: .7rem; color: #fff; font-weight: 700; letter-spacing: .02em; }
.cm-g0 { background: linear-gradient(135deg, #0D9488, #06B6D4); } .cm-g1 { background: linear-gradient(135deg, #6366F1, #A855F7); }
.cm-g2 { background: linear-gradient(135deg, #F59E0B, #F43F5E); } .cm-g3 { background: linear-gradient(135deg, #0B0F1A, #465068); }
.cm-chip { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); text-decoration: none; }
a.cm-chip:hover { color: var(--text); border-color: var(--text); }
.cm-chip.is-on { background: var(--text); color: var(--surface); border-color: var(--text); }
.cm-chip-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.cm-chip-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.cm-chip-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.cm-chip-pro { background: var(--volt); color: var(--volt-text); border-color: transparent; }
.cm-filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.cm-search { display: flex; gap: .5rem; }
.cm-search input { min-width: 200px; }
.cm-pager { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.cm-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 18px; }

/* Rendered markdown */
.prose { font-size: 1.07rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose h2 { font-size: 1.6rem; margin: 2rem 0 .6rem; line-height: 1.2; } .prose h3 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; } .prose h4, .prose h5 { margin: 1.3rem 0 .4rem; }
.prose p { margin: 0 0 1rem; } .prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; } .prose li { margin: .25rem 0; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote { margin: 1.2rem 0; padding: .2rem 1.1rem; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--text-muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-family: var(--font-mono); font-size: .92em; padding: .1em .4em; border-radius: 6px; background: var(--surface-2); }
.prose pre { margin: 0 0 1.1rem; padding: 1rem 1.1rem; overflow-x: auto; border-radius: 12px; background: #0B0F1A; color: #E6E9F2; line-height: 1.5; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2rem; font-size: .96rem; }
.prose th, .prose td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); } .prose th { background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Blog post */
.cm-post-head { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.6rem; }
.cm-post-meta { display: flex; gap: .5rem 1rem; flex-wrap: wrap; color: var(--text-muted); font-size: .95rem; }
.cm-post-foot { display: flex; flex-direction: column; gap: 1rem; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }

/* Learn */
.lm { display: flex; flex-direction: column; gap: 1.5rem; }
.lm-section-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.lm-progress { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; width: 100%; }
.lm-progress > progress, .lm-progress progress { display: block; width: 100%; height: 100%; appearance: none; border: 0; background: transparent; }
.lm-progress progress::-webkit-progress-bar { background: transparent; }
.lm-progress progress::-webkit-progress-value { background: #0D9488; border-radius: 999px; }
.lm-progress progress::-moz-progress-bar { background: #0D9488; border-radius: 999px; }
.lm-rec { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
.lm-stack { display: flex; flex-direction: column; gap: .6rem; }
.lm-why { font-size: .88rem; color: var(--text-muted); border-left: 3px solid #6366F1; padding-left: .6rem; }
.lm-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.lm-outline { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: .6rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.lm-mod { padding: .7rem .7rem .3rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.lm-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 10px; color: inherit; text-decoration: none; font-size: .95rem; }
.lm-item:hover { background: var(--surface-2); }
.lm-item.is-current { background: var(--surface-2); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.lm-tick { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; }
.lm-tick.is-done { background: #0D9488; border-color: #0D9488; color: #fff; }
.lm-tick.is-done::after { content: "✓"; font-size: .7rem; line-height: 1; }
.lm-lock { margin-left: auto; font-size: .75rem; color: var(--text-muted); }
.lm-main { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 1.6rem clamp(1rem, 3vw, 2.2rem); min-width: 0; display: flex; flex-direction: column; gap: 1.2rem; }
.lm-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.lm-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lm-nav { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--border); }
.lm-lock-card { text-align: center; padding: 2.5rem 1rem; border: 1px dashed var(--border); border-radius: 18px; display: flex; flex-direction: column; gap: .8rem; align-items: center; }
.lm-quiz { border: 1px solid var(--border); border-radius: 18px; padding: 1.2rem 1.3rem; background: var(--surface-2); display: flex; flex-direction: column; gap: 1.1rem; }
.lm-q { display: flex; flex-direction: column; gap: .5rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.lm-q legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
.lm-opt { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.lm-opt input { margin-top: .25rem; }
.lm-opt.is-right { border-color: var(--ok); background: var(--ok-bg); }
.lm-opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.lm-expl { font-size: .92rem; color: var(--text-muted); }
.lm-result { padding: .9rem 1.1rem; border-radius: 14px; font-weight: 600; }
.lm-result.is-pass { background: var(--ok-bg); color: var(--ok); } .lm-result.is-fail { background: var(--warn-bg); color: var(--warn); }

/* Admin forms */
.cm-form { display: flex; flex-direction: column; gap: 1rem; max-width: 900px; }
.cm-field { display: flex; flex-direction: column; gap: .35rem; }
.cm-field label, .cm-field .cm-lbl { font-weight: 600; font-size: .92rem; }
.cm-field small { color: var(--text-muted); }
.cm-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cm-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cm-md { font-family: var(--font-mono); font-size: .92rem; min-height: 320px; line-height: 1.55; }
.cm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cm-preview { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; background: var(--surface); min-height: 320px; overflow: auto; }
.cm-errors { padding: .8rem 1rem; border-radius: 12px; background: var(--bad-bg); color: var(--bad); }
.cm-errors ul { margin: 0; padding-left: 1.1rem; }
.cm-ok { padding: .7rem 1rem; border-radius: 12px; background: var(--ok-bg); color: var(--ok); }
.cm-checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.cm-checks label { font-weight: 400; display: flex; gap: .4rem; align-items: center; }
.cm-table { width: 100%; border-collapse: collapse; }
.cm-table th, .cm-table td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cm-table th { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.cm-panel { border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.2rem; background: var(--surface); display: flex; flex-direction: column; gap: .8rem; }
.cm-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cm-inline input[type="number"] { width: 5rem; }
.cm-qblock { border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--surface-2); }
@media (max-width: 860px) {
  .lm-layout { grid-template-columns: 1fr; } .lm-outline { position: static; max-height: none; }
  .cm-2, .cm-3, .cm-split { grid-template-columns: 1fr; }
}

/* Images + attachments */
.cm-cover-img { display: block; width: 100%; height: 160px; object-fit: cover; border-radius: 12px; margin: -.2rem 0 .3rem; background: var(--surface-2); }
.cm-hero-img { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 18px; background: var(--surface-2); }
.cm-cover-thumb { display: block; max-width: 360px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.cm-cover-thumb[hidden] { display: none; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 1.2rem auto; }
.cm-att-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.cm-att-row { display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cm-att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
a.cm-att-row { color: inherit; text-decoration: none; }
a.cm-att-row:hover { border-color: var(--text); }
.cm-att-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); font-size: .68rem; font-weight: 700; letter-spacing: .03em; }
[data-att-empty][hidden], [data-att-status]:empty, [data-cover-status]:empty { display: none; }
.is-ok { color: var(--ok); } .is-bad { color: var(--bad); }
.btn[hidden], .cm-inline [hidden], .cm-field [hidden], .cm-panel [hidden] { display: none !important; }
