:root {
  --ink: #071224;
  --navy: #031c32;
  --navy-2: #082a45;
  --gold: #d5a153;
  --gold-2: #f0c979;
  --paper: #fffaf3;
  --paper-2: #f6efe5;
  --line: rgba(42, 33, 24, .16);
  --muted: #687080;
  --shadow: 0 18px 46px rgba(31, 24, 16, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, rgba(213, 161, 83, .16), transparent 30rem),
    linear-gradient(180deg, #f8f2ea 0%, #fffaf3 78%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.publisher-header {
  min-height: 78px;
  padding: 14px clamp(18px, 4vw, 58px);
  display: flex;
  align-items: center;
  gap: 28px;
  color: #fff8ec;
  background: linear-gradient(90deg, #03182b 0%, #062743 100%);
  border-bottom: 1px solid rgba(213, 161, 83, .28);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  min-width: 260px;
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .34));
}

.brand strong {
  display: block;
  font: 700 28px/1 Georgia, "Times New Roman", serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #f3d38a;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.publisher-header nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: clamp(16px, 3vw, 34px);
  flex-wrap: wrap;
}

.publisher-header nav a {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

main {
  padding: 34px clamp(18px, 4vw, 58px) 58px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 410px);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #9a6b24;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 0 0 16px;
  font: 700 clamp(38px, 5vw, 66px)/.98 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
}

.engine-card,
.project-panel,
.document-preview,
.workflow article {
  background: rgba(255, 252, 247, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.engine-card {
  padding: 22px;
}

.engine-card span,
.panel-top span,
.claim-type {
  display: block;
  color: #9a6b24;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.engine-card strong {
  display: block;
  margin: 9px 0;
  font: 700 24px/1.15 Georgia, "Times New Roman", serif;
}

.engine-card p,
.workflow p,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.workflow article {
  min-height: 150px;
  padding: 18px;
}

.workflow b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: #081827;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-radius: 50%;
}

.workflow strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.project-panel {
  position: sticky;
  top: 100px;
  padding: 20px;
}

.panel-top {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-top strong {
  display: block;
  margin-top: 6px;
  font: 700 22px/1.15 Georgia, "Times New Roman", serif;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.source-ingest {
  margin: 18px 0;
  padding: 14px;
  background: rgba(8, 42, 69, .05);
  border: 1px solid rgba(8, 42, 69, .12);
  border-radius: 7px;
}

.source-ingest > span {
  display: block;
  margin-bottom: 12px;
  color: #9a6b24;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.source-ingest button {
  width: 100%;
}

.inline-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  margin: 6px 0 12px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

.inline-check input {
  width: auto;
  min-height: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(42, 33, 24, .2);
  border-radius: 6px;
}

textarea {
  min-height: 92px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.45;
  resize: vertical;
}

.media-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.media-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.media-picker p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.media-choice {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
}

.media-choice img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.media-choice span {
  display: block;
  padding: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  color: #071827;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  font-weight: 900;
  cursor: pointer;
}

button.secondary {
  color: #12304a;
  background: #fff;
  border: 1px solid rgba(42, 33, 24, .2);
}

.note {
  margin: 16px 0 0;
  font-size: 13px;
}

.job-status {
  min-height: 48px;
  margin: 14px 0 0;
  padding: 12px;
  color: #17304a;
  background: rgba(213, 161, 83, .12);
  border: 1px solid rgba(213, 161, 83, .24);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.job-status.error {
  color: #8c2f20;
  background: rgba(166, 73, 61, .1);
  border-color: rgba(166, 73, 61, .22);
}

.document-preview {
  overflow: hidden;
}

.publication-cover {
  min-height: 310px;
  padding: clamp(28px, 5vw, 54px);
  color: #fff8ec;
  background:
    linear-gradient(90deg, rgba(3, 24, 43, .96), rgba(5, 33, 55, .82)),
    url("../../../assets/brand/ui/scribe-logo-640.png") right -120px center / 520px auto no-repeat;
}

.publication-cover .series {
  margin: 0 0 44px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.publication-cover h2 {
  max-width: 720px;
  margin: 0;
  font: 700 clamp(40px, 5vw, 72px)/.95 Georgia, "Times New Roman", serif;
}

.publication-cover h3 {
  margin: 10px 0 28px;
  color: #f3d38a;
  font: 500 clamp(24px, 3vw, 40px)/1.1 Georgia, "Times New Roman", serif;
}

.meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: rgba(255, 248, 236, .82);
  font-size: 13px;
}

.doc-body {
  padding: clamp(22px, 4vw, 42px);
}

.doc-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section h3 {
  margin: 0 0 8px;
  font: 700 27px/1.1 Georgia, "Times New Roman", serif;
}

.doc-section p,
.doc-section li {
  line-height: 1.62;
}

.status-grid,
.claim-grid,
.source-grid {
  display: grid;
  gap: 12px;
}

.status-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.status-card,
.claim-card,
.source-card {
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(42, 33, 24, .14);
  border-radius: 7px;
}

.status-card strong,
.claim-card strong,
.source-card strong {
  display: block;
  margin-bottom: 6px;
}

.source-card a {
  display: inline-block;
  margin: 3px 0 7px;
  color: #0b4b75;
  font-size: 13px;
  font-weight: 800;
}

.claim-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.claim-card {
  display: grid;
  gap: 8px;
}

.claim-card.candidate {
  background: rgba(213, 161, 83, .08);
  border-color: rgba(213, 161, 83, .26);
}

.confidence {
  width: max-content;
  padding: 4px 8px;
  color: #082a45;
  background: rgba(213, 161, 83, .16);
  border: 1px solid rgba(213, 161, 83, .34);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.receipt-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.source-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.draft-blocks {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.draft-block {
  padding: 12px 14px;
  background: rgba(8, 42, 69, .05);
  border: 1px solid rgba(8, 42, 69, .12);
  border-radius: 7px;
}

.draft-block b {
  display: block;
  margin-bottom: 5px;
  color: #9a6b24;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.agent-log {
  padding-left: 18px;
  color: var(--muted);
}

.lesson-grid {
  display: grid;
  gap: 14px;
}

.lesson-card {
  padding: 16px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(42, 33, 24, .14);
  border-radius: 7px;
}

.lesson-card h4 {
  margin: 0 0 8px;
  font: 700 22px/1.15 Georgia, "Times New Roman", serif;
}

.lesson-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.lesson-meta span {
  padding: 4px 8px;
  color: #082a45;
  background: rgba(213, 161, 83, .14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.lesson-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.lesson-columns b {
  display: block;
  margin-bottom: 6px;
  color: #9a6b24;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lesson-columns ul {
  margin: 0;
  padding-left: 18px;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.review-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.review-actions button.reject {
  color: #8c2f20;
  background: #fff;
  border: 1px solid rgba(166, 73, 61, .22);
}

.loading {
  padding: 40px;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .publisher-header,
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .publisher-header {
    display: grid;
  }

  .publisher-header nav {
    justify-content: flex-start;
  }

  .workflow,
  .status-grid,
  .claim-grid,
  .source-grid,
  .lesson-columns {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .project-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  main {
    padding-inline: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    font-size: 22px;
  }

  .workflow,
  .status-grid,
  .claim-grid,
  .source-grid,
  .lesson-columns {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .publisher-header,
  .hero,
  .workflow,
  .project-panel {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .document-preview {
    border: 0;
    box-shadow: none;
  }

  .publication-cover {
    min-height: 9in;
    page-break-after: always;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .doc-section {
    break-inside: avoid;
  }
}
