/* cwrcheck.com -- "registry ledger" design language.
   The subject is fixed-width ledgers of works and shares, and the page
   leans into it: warm paper ground, deep ink navy, a registrar's stamp
   red for accents, an editorial serif (Fraunces) for display, and IBM
   Plex Mono for anything that is data -- record types, line numbers,
   shares. Layout bones follow the classic validator pattern: upload
   first, results as cards, everything on one sheet. */

:root {
  --paper: #f6f2ea;
  --paper-deep: #efe9dd;
  --sheet: #fdfbf7;
  --ink: #1a2436;
  --ink-soft: #47526a;
  --muted: #8a8375;
  --rule: #ddd5c6;
  --rule-soft: #e9e3d6;
  --navy: #1a2436;
  --stamp: #b23a2a;          /* registrar's red */
  --stamp-soft: #f6e3df;
  --cleared: #2e6b4f;        /* "cleared" stamp green */
  --cleared-soft: #e2eee7;
  --caution: #8a6114;
  --caution-soft: #f3ead2;
  --link: #24568f;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(26,36,54,0.025) 31px 32px),
    var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--stamp); color: #fff; }

a { color: var(--link); text-decoration-color: rgba(36,86,143,0.35); }
a:hover { text-decoration-color: currentColor; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-deep);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

/* --- staggered page reveal ---------------------------------------- */
.reveal { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.reveal:nth-of-type(2) { animation-delay: 0.07s; }
.reveal:nth-of-type(3) { animation-delay: 0.14s; }
.reveal:nth-of-type(4) { animation-delay: 0.21s; }
.reveal:nth-of-type(5) { animation-delay: 0.28s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .file-card { animation: none; }
}

/* --- top bar ------------------------------------------------------ */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 1.6rem;
  border-bottom: 3px solid var(--stamp);
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
}
.topnav { display: flex; gap: 1.4rem; }
.topnav a {
  color: #c8cfdd;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.topnav a:hover { color: #fff; }

/* --- sheet -------------------------------------------------------- */
.sheet {
  background: var(--sheet);
  width: min(62rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.2rem clamp(1.4rem, 5vw, 4rem) 4rem;
  flex: 1;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  box-shadow: 0 0 0 1px rgba(26,36,54,0.02), 0 18px 40px -28px rgba(26,36,54,0.35);
}

/* --- hero --------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
  margin: 0 0 0.9rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.lede {
  max-width: 40rem;
  color: var(--ink-soft);
  margin: 0 0 2.2rem;
}

/* --- dropzone ----------------------------------------------------- */
.dropzone {
  border: 1.5px dashed var(--rule);
  border-radius: 6px;
  background: var(--sheet);
  padding: 6px;
  transition: border-color 0.2s, transform 0.2s;
}
.dz-inner {
  border-radius: 3px;
  background:
    linear-gradient(rgba(253,251,247,0.92), rgba(253,251,247,0.92)),
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(26,36,54,0.05) 26px 27px),
    var(--paper-deep);
  text-align: center;
  padding: 2.4rem 1rem 2.6rem;
  transition: background-color 0.2s;
}
.dropzone.dragover { border-color: var(--stamp); transform: scale(1.004); }
.dropzone.dragover .dz-inner { background-color: var(--stamp-soft); }
.dz-record {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--rule);
  margin: 0 0 1.1rem;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}
.dz-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 0.3rem;
}
.dz-subtitle {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 3px;
  padding: 0.65rem 1.6rem;
  font: 600 0.92rem var(--sans);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(26,36,54,0.35);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.select-btn:hover { background: #24334c; transform: translateY(-1px); box-shadow: 0 3px 0 rgba(26,36,54,0.35); }
.select-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(26,36,54,0.35); }
.select-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* --- privacy line ------------------------------------------------- */
.privacy {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
  margin: 1.2rem 0 0;
}
.privacy svg { flex: none; color: var(--cleared); }

/* --- ruled section labels ----------------------------------------- */
.rule-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1rem;
}
.rule-label span {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  white-space: nowrap;
}
.rule-label::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.pro-badge {
  font: 600 0.66rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--stamp);
  border: 1px solid var(--stamp);
  border-radius: 2px;
  padding: 0.22rem 0.5rem;
  white-space: nowrap;
}

/* --- results ------------------------------------------------------ */
.results { margin-top: 2.2rem; }
.busy { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.file-card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  margin-bottom: 1rem;
  overflow: hidden;
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.file-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  transition: background 0.12s;
}
.file-head:hover { background: var(--paper-deep); }
.file-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.file-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  white-space: nowrap;
}
.spacer { flex: 1; }
.chip {
  font: 600 0.7rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}
.chip.ok   { color: var(--cleared); background: var(--cleared-soft); box-shadow: inset 0 0 0 1px var(--cleared); }
.chip.bad  { color: var(--stamp);   background: var(--stamp-soft);   box-shadow: inset 0 0 0 1px var(--stamp); }
.chip.warn { color: var(--caution); background: var(--caution-soft); box-shadow: inset 0 0 0 1px var(--caution); }

.file-body { border-top: 1px solid var(--rule-soft); padding: 1rem 1.1rem; }
.file-body[hidden] { display: none; }

.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2.2rem;
  margin: 0 0 1rem;
  padding: 0 0 0.9rem;
  list-style: none;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.86rem;
}
.kv li b {
  display: block;
  color: var(--muted);
  font: 600 0.66rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}

.finding-row {
  display: flex;
  gap: 0.8rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.88rem;
  align-items: baseline;
}
.finding-row:first-of-type { border-top: 0; }
.finding-row .lineno {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--link);
  white-space: nowrap;
  min-width: 4.6rem;
}
.report-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--link);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.report-link:hover { text-decoration: underline; }
.more-note { color: var(--muted); font-size: 0.8rem; padding-top: 0.5rem; }

/* --- generation (paid) -------------------------------------------- */
.generate {
  margin-top: 3.4rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.6rem 1.8rem 1.7rem;
  position: relative;
}
.generate::before {
  /* perforation strip: this section is the "tear-off order form" */
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  border-top: 2px dashed var(--rule);
}
.generate p { margin: 0 0 1.1rem; color: var(--ink-soft); }
.gen-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}
.gen-file { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.key-input {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--sheet);
  padding: 0.6rem 0.9rem;
  font: 0.86rem var(--mono);
  min-width: 13rem;
  color: var(--ink);
}
.key-input:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.ghost-btn {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 3px;
  padding: 0.6rem 1.2rem;
  font: 600 0.88rem var(--sans);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ghost-btn:not(:disabled):hover { background: var(--navy); color: #fff; }
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.go-btn {
  background: var(--stamp);
  color: #fff;
  border: 0;
  border-radius: 3px;
  padding: 0.65rem 1.5rem;
  font: 600 0.9rem var(--sans);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(122,34,22,0.5);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.go-btn:not(:disabled):hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 3px 0 rgba(122,34,22,0.5); }
.go-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.gen-note { color: var(--muted); font-size: 0.84rem; margin: 1rem 0 0; }
.gen-note.error { color: var(--stamp); }
.gen-note.ok { color: var(--cleared); }
.buy-row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }
.lint-results { margin-top: 1.1rem; }
.lint-results .finding-row:first-child { border-top: 0; }
.key-reveal {
  margin-top: 1.1rem;
  background: var(--cleared-soft);
  border: 1px solid var(--cleared);
  border-radius: 3px;
  padding: 0.9rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

/* --- about grid --------------------------------------------------- */
.about { margin-top: 3.4rem; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0 2.4rem;
}
.about-grid h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 1rem 0 0.3rem;
}
.about-grid h3::before {
  content: "§ ";
  color: var(--stamp);
}
.about-grid p { margin: 0 0 0.8rem; color: var(--ink-soft); font-size: 0.9rem; }

/* --- footer ------------------------------------------------------- */
.foot {
  background: var(--navy);
  color: #8f99ad;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 1.1rem 1rem;
  border-top: 3px solid var(--stamp);
}

@media (max-width: 640px) {
  .sheet { width: 100%; border-left: 0; border-right: 0; padding-top: 2rem; }
  .topnav { display: none; }
  .gen-row .key-input { min-width: 100%; }
}

/* --- funnel refinements (marketing pass) --------------------------- */
.price-chip {
  font: 600 0.7rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--cleared);
  background: var(--cleared-soft);
  box-shadow: inset 0 0 0 1px var(--cleared);
  border-radius: 2px;
  padding: 0.24rem 0.6rem;
  white-space: nowrap;
}
.gen-lede { max-width: 44rem; }
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem 1.6rem;
}
.steps li { counter-increment: step; position: relative; padding-left: 2.3rem; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.1rem;
  width: 1.6rem; height: 1.6rem;
  border: 1.5px solid var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 600 0.85rem var(--serif);
}
.steps b { display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }
.steps span { display: block; color: var(--ink-soft); font-size: 0.85rem; line-height: 1.5; }
.unlock {
  margin-top: 1.2rem;
  border: 1px solid var(--cleared);
  border-radius: 4px;
  background: var(--cleared-soft);
  padding: 1rem 1.2rem;
}
.estimate { margin-bottom: 0.9rem; font-size: 0.95rem; }
.estimate-price {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  margin-right: 0.25rem;
}
.estimate-detail { color: var(--ink-soft); font-size: 0.88rem; }
.unlock-alt { font-size: 0.88rem; white-space: nowrap; }
.admin-note {
  margin-top: 1.3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--muted);
  font-size: 0.82rem;
}

/* --- report actions ------------------------------------------------ */
.report-actions {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.report-actions .report-link { margin-top: 0; }
.report-hint { color: var(--muted); font-size: 0.78rem; }

/* --- FAQ ----------------------------------------------------------- */
.faq details {
  border-bottom: 1px solid var(--rule-soft);
  padding: 0.4rem 0;
}
.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 0;
  list-style-position: outside;
}
.faq summary:hover { color: var(--link); }
.faq details p {
  margin: 0.2rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 46rem;
}

/* --- share link ---------------------------------------------------- */
.share-box { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.share-url {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--sheet);
  padding: 0.4rem 0.7rem;
  font: 0.78rem var(--mono);
  color: var(--ink);
  min-width: 19rem;
}

/* --- FAQ lists ------------------------------------------------------ */
.faq details ul {
  margin: 0.2rem 0 0.8rem;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 44rem;
}
.faq details li { margin-bottom: 0.2rem; }
.faq details li::marker { color: var(--stamp); }

/* --- managed service / lead form ----------------------------------- */
.managed { border-left: 3px solid var(--stamp); }
.managed-chip { color: #fff; background: var(--stamp); box-shadow: none; }
.lead-form .gen-row { margin-bottom: 0.7rem; }
.lead-message { width: 100%; resize: vertical; font-family: var(--sans); }
.hp-field { position: absolute; left: -9999px; height: 0; width: 0;
  opacity: 0; pointer-events: none; }

/* --- KTG design blend ----------------------------------------------- */
/* Shared family traits with kanetechgroup.com: the square brand-mark
   tile, italic Fraunces emphasis in display type, hairline borders,
   and the structured footer. The ledger identity (paper ruling, navy
   chrome, stamp red) stays. */
/* Italic emphasis applies to display text only -- scoped to the
   heading span so it can never repaint a chip sitting beside it. */
.hero h1 em, .rule-label > span em {
  font-style: italic;
  font-weight: 600;
  color: var(--stamp);
}
.rule-label .managed-chip { color: #fff; font-style: normal; }
.brand-mark {
  display: inline-block;
  width: 22px; height: 22px;
  background: var(--sheet);
  color: var(--navy);
  border-radius: 5px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.78rem;
  text-align: center;
  line-height: 22px;
  margin-right: 0.55rem;
  vertical-align: 2px;
}
.managed-eyebrow { color: var(--muted); margin-bottom: 0.7rem; }
.foot { text-align: left; }
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  max-width: 62rem;
  margin: 0 auto;
}
.foot-brand { color: #c8cfdd; }
.foot-brand a { color: #fff; text-decoration: none; }
.foot-brand a:hover { text-decoration: underline; }
.foot-brand .brand-mark { background: var(--stamp); color: #fff; }
.foot-links { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.foot-links a {
  color: #8f99ad;
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.foot-links a:hover { color: #fff; }
.foot-copy {
  max-width: 62rem;
  margin: 0.7rem auto 0;
  color: #6c7689;
}
.report-link { transition: transform 0.12s; display: inline-block; }
.report-link:hover { transform: translateX(2px); }

/* --- key request (MediaBlaze-style single-row form) ---------------- */
.buy-row { align-items: center; }
.buy-note { flex-basis: 100%; margin: 0.2rem 0 0; }
.key-success {
  margin-top: 0.8rem;
  background: var(--cleared-soft);
  border: 1px solid var(--cleared);
  border-radius: 3px;
  padding: 0.8rem 1.1rem;
  color: var(--cleared);
  font-size: 0.9rem;
  max-width: 34rem;
}

/* --- key request (MediaBlaze-style single-row form) ---------------- */
.buy-row { align-items: center; }
.buy-note { flex-basis: 100%; margin: 0.2rem 0 0; }
.key-success {
  margin-top: 0.8rem;
  background: var(--cleared-soft);
  border: 1px solid var(--cleared);
  border-radius: 3px;
  padding: 0.8rem 1.1rem;
  color: var(--cleared);
  font-size: 0.9rem;
  max-width: 34rem;
}

/* --- catalog builder form ------------------------------------------ */
.builder { margin-top: 0.4rem; }
.b-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.7rem 0.9rem;
  align-items: end;
}
.b-field { display: flex; flex-direction: column; gap: 0.25rem; }
.b-field span {
  font: 600 0.66rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.b-field span em { font-style: normal; text-transform: none; letter-spacing: 0; }
.b-field .key-input { min-width: 0; width: 100%; }
.b-wide { grid-column: span 2; }
.b-sender {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--sheet);
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}
.work-card {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: 4px;
  background: var(--sheet);
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 0.9rem;
}
.work-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.work-label {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
}
.remove-work, .remove-writer {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.remove-work:hover, .remove-writer:hover { color: var(--stamp); }
.writers { margin-top: 0.8rem; }
.writer-row {
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)) 2rem;
  border-top: 1px dashed var(--rule-soft);
  padding-top: 0.7rem;
  margin-top: 0.7rem;
}
.writer-row:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.ghost-btn.small { padding: 0.35rem 0.8rem; font-size: 0.8rem; margin-top: 0.7rem; }
.pub-toggle {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.pub-toggle input { accent-color: var(--stamp); margin-right: 0.4rem; }
.pub-fields { margin-top: 0.7rem; }
.json-alt { margin-top: 0.9rem; }
@media (max-width: 640px) {
  .b-wide { grid-column: span 1; }
}

/* Guide reference tables (record layouts) */
.guide table { border-collapse: collapse; width: 100%; margin: 1rem 0;
  font-size: .85rem; }
.guide .table-wrap { overflow-x: auto; }
.guide th, .guide td { text-align: left; padding: .4rem .6rem;
  border-bottom: 1px solid var(--line, #ddd5c6); vertical-align: top; }
.guide th { font: 600 .68rem var(--mono, monospace);
  text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.guide td.mono { font-family: var(--mono, monospace); font-size: .8rem;
  white-space: nowrap; }
