/* Crestmas Write — layout and components. Colours come from brand.css (sampled from the Crestmas Hub logo). */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { text-underline-offset: 2px; }
.text-brand { color: var(--cw-purple-600) !important; }
.cw-skip:focus { position: fixed; z-index: 2000; top: .5rem; left: .5rem; background: #fff; padding: .5rem 1rem; border-radius: 8px; }
.cw-narrow { max-width: 42rem; }
.cw-narrow-lg { max-width: 52rem; }
.cw-prose { max-width: 48rem; }
.cw-prose h2 { margin-top: 1.5rem; }
.cw-pre { white-space: pre-wrap; word-break: break-word; }
.cw-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cw-announce { background: var(--cw-gold-500); color: var(--cw-purple-900); font-weight: 500; }

/* Header and footer */
.cw-header { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--cw-border); position: sticky; top: 0; z-index: 1030; }
.cw-header .nav-link { color: var(--cw-ink-soft); font-weight: 500; }
.cw-header .nav-link:hover, .cw-header .nav-link.active { color: var(--cw-purple-600); }
.cw-footer { background: var(--cw-purple-50); border-top: 1px solid var(--cw-border); }
.cw-footer a { color: var(--cw-ink-soft); text-decoration: none; }
.cw-footer a:hover { color: var(--cw-purple-600); text-decoration: underline; }

/* Marketing */
.cw-hero-logo { max-width: 340px; filter: drop-shadow(0 18px 30px rgba(61,12,147,.22)); }
.cw-about-logo { max-width: 280px; }
.cw-steps { counter-reset: s; }
.cw-step-num { flex: 0 0 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--cw-purple-600); color: #fff; display: grid; place-items: center; font-weight: 700; }
.accordion-button:not(.collapsed) { background: var(--cw-purple-50); color: var(--cw-purple-700); }

/* Forms and meters */
.form-control:focus, .form-select:focus { border-color: var(--cw-purple-500); box-shadow: 0 0 0 .2rem rgba(109,40,217,.18); }
.cw-meter { height: .7rem; accent-color: var(--cw-purple-600); }

/* Workspace */
.cw-app-main { background: var(--cw-bg); }
.cw-workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
@media (min-width: 992px) { .cw-side { position: sticky; top: 4.5rem; max-height: calc(100vh - 5rem); overflow-y: auto; } }
.cw-workspace > * { min-width: 0; }
.cw-title { font-weight: 600; border-color: transparent; background: transparent; }
.cw-title:hover, .cw-title:focus { border-color: var(--cw-border); background: #fff; }
.cw-editor { min-height: 46vh; }
.cw-output { min-height: 46vh; max-height: 70vh; overflow: auto; word-break: break-word; }
.cw-ins { background: #d9f5e6; color: #0b5d3b; text-decoration: none; border-radius: 3px; padding: 0 2px; }
.cw-del { background: #fde3e0; color: #8f1d12; border-radius: 3px; padding: 0 2px; }
.cw-prot { background: #fff3c4; border-radius: 3px; padding: 0 2px; }
.cw-doclist li { border-radius: 10px; padding: .4rem .5rem; display: flex; align-items: center; justify-content: space-between; gap: .25rem; }
.cw-doclist li:hover, .cw-doclist li.is-active { background: var(--cw-purple-50); }
.cw-doclist li.is-active { box-shadow: inset 3px 0 0 var(--cw-gold-500); }
.cw-doclist .cw-doc-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: var(--cw-ink); }
.cw-doclist .cw-doc-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-doclist small { color: var(--cw-ink-soft); }
.cw-chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--cw-purple-100); color: var(--cw-purple-700); border-radius: 999px; padding: .1rem .3rem .1rem .65rem; font-size: .8rem; }
.cw-chip button { border: 0; background: transparent; color: inherit; line-height: 1; padding: 0 .3rem; font-size: 1rem; }
.cw-suggestion { border: 1px solid var(--cw-border); border-radius: 10px; padding: .5rem .6rem; margin-bottom: .5rem; background: #fff; }
.cw-sev { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: .05rem .4rem; font-weight: 700; }
.cw-sev-definite { background: #fde3e0; color: #8f1d12; }
.cw-sev-likely { background: #fff3c4; color: #7a5300; }
.cw-sev-style { background: var(--cw-purple-100); color: var(--cw-purple-700); }
.cw-stat { background: var(--cw-purple-50); border-radius: 10px; padding: .4rem .7rem; }
@media (max-width: 1199.98px) { .cw-workspace { grid-template-columns: 240px minmax(0, 1fr) 300px; } }
@media (max-width: 991.98px) {
  .cw-workspace { grid-template-columns: 1fr; }
  .cw-editor, .cw-output { min-height: 32vh; }
}

/* Admin */
.cw-admin .list-group-item.active { background: var(--cw-purple-600); border-color: var(--cw-purple-600); }
.cw-admin .table > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }
