:root {
  --navy: #10233f;
  --blue: #1e5eff;
  --indigo: #4f46e5;
  --teal: #087f74;
  --gold: #b7791f;
  --red: #b42318;
  --ink: #182230;
  --muted: #5f6c7b;
  --line: #d9e1ec;
  --soft: #f4f7fb;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(24, 34, 48, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #edf3ff 0, #f8fafc 360px, #fff 100%);
  line-height: 1.55;
}

a { color: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 900; color: var(--navy); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--blue), var(--indigo)); }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 9px 13px; border-radius: 999px; color: #334155; font-weight: 750; }
.nav a:hover, .nav a[aria-current="page"] { background: #eaf0ff; color: #1d4ed8; }

.shell { max-width: 1420px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 60px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 26px; align-items: stretch; margin-bottom: 26px; }
.hero-copy, .hero-note, .card { background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.hero-copy { padding: clamp(28px, 5vw, 58px); }
.hero-note { padding: 25px; border-left: 6px solid var(--indigo); }
.eyebrow { margin: 0 0 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--indigo); font-size: .78rem; }
h1 { margin: 0 0 16px; color: var(--navy); font-size: clamp(2.1rem, 4.8vw, 4.8rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin: 0 0 8px; color: var(--navy); line-height: 1.15; }
h3 { color: var(--navy); }
.lead { max-width: 760px; color: #42526a; font-size: 1.08rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn, button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--indigo);
  color: white;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}
.btn.secondary, button.secondary { background: #e8edf5; color: #172033; }
button:disabled { opacity: .52; cursor: not-allowed; }

.module-grid, .feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.module-card, .feature-card { padding: 25px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.module-card { text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.module-card:hover { transform: translateY(-3px); border-color: #9eb5ff; }
.module-card .tag { display: inline-block; padding: 5px 9px; border-radius: 999px; color: #3730a3; background: #eef2ff; font-size: .78rem; font-weight: 850; }

.grid-two { display: grid; grid-template-columns: minmax(360px, .88fr) minmax(470px, 1.12fr); gap: 22px; align-items: start; }
.card { padding: 24px; }
.form-card label { display: block; margin: 14px 0; font-weight: 780; color: #24324a; }
.field-label { display: block; margin-bottom: 6px; }
.help, .muted { color: var(--muted); font-size: .91rem; }
input, select, textarea {
  width: 100%;
  border: 1.5px solid #c7d1df;
  border-radius: 13px;
  padding: 12px 13px;
  background: white;
  color: #111827;
  font: inherit;
}
select { background: #eef4ff; border-color: #9db8ff; font-weight: 750; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(30,94,255,.14); border-color: var(--blue); }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.check { display: flex !important; gap: 9px; align-items: center; font-weight: 650 !important; }
.check input { width: auto; }
.priority { padding: 13px; border: 1px solid #bed2ff; border-left: 5px solid var(--blue); border-radius: 16px; background: #f2f6ff; }
.status { min-height: 25px; color: #334155; font-weight: 700; }
.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.output-box { min-height: 650px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; line-height: 1.55; }
.result-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }

.idea-list { display: grid; gap: 16px; }
.idea-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: #fbfdff; }
.idea-card h3 { margin: 0 0 6px; }
.idea-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #ecfdf3; color: #067647; font-size: .8rem; font-weight: 800; }
.pill.score { background: #eef2ff; color: #4338ca; }
.idea-section { margin: 10px 0; }
.idea-section strong { color: #24324a; }
.idea-section ul { margin: 5px 0 0 18px; padding: 0; }
.warning { padding: 11px 13px; border-radius: 12px; color: #8a2b0d; background: #fff3e8; border: 1px solid #ffd0a8; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px,1fr)); gap: 12px; }
.source { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.source a { color: #1d4ed8; font-weight: 750; }
.footer { padding: 26px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .hero, .grid-two, .module-grid, .feature-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .two-cols { grid-template-columns: 1fr; }
  .result-head { flex-direction: column; }
}

/* Article source attachment workflow */
.source-search-panel {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #b9caff;
  border-left: 5px solid var(--indigo);
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 100%);
}
.source-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.source-panel-head h3 { margin: 0 0 5px; }
.source-panel-head p { margin: 0; }
.source-count-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e8edff;
  color: #3730a3;
  font-size: .82rem;
  font-weight: 900;
}
.source-controls {
  display: grid;
  grid-template-columns: minmax(150px, .42fr) minmax(240px, 1fr);
  gap: 14px;
  align-items: end;
}
.compact-label { margin: 8px 0 !important; }
.source-check {
  margin: 8px 0 13px !important;
  padding: 10px 12px;
  border: 1px solid #d6def1;
  border-radius: 12px;
  background: white;
}
.compact-actions { margin-top: 12px; }
.ghost-button {
  background: white;
  color: #344054;
  border: 1px solid #cbd5e1;
}
.attached-summary {
  margin: 10px 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #28543c;
  font-size: .91rem;
}
.compact-source-grid {
  grid-template-columns: 1fr;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}
.source-compact { padding: 11px 12px; }
.source-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.source-origin {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: .69rem;
  font-weight: 850;
}
.source-abstract {
  margin: 9px 0;
  color: #43516a;
  font-size: .88rem;
}
.source-hint {
  margin: 8px 0;
  color: #4b5563;
  font-size: .82rem;
}

@media (max-width: 700px) {
  .source-panel-head, .source-title-line { flex-direction: column; }
  .source-controls { grid-template-columns: 1fr; }
  .source-origin { align-self: flex-start; }
}

/* Staged independent-article workflow and research resources */
.stage-panel,
.continuation-panel,
.research-resource-panel {
  margin: 18px 0;
  padding: 17px;
  border: 1px solid #c7d5ee;
  border-radius: 18px;
  background: #f8fbff;
}
.stage-panel { border-left: 5px solid var(--teal); }
.continuation-panel { border-left: 5px solid var(--gold); background: #fffaf1; }
.research-resource-panel { border-left: 5px solid var(--blue); background: linear-gradient(180deg, #f5f8ff 0%, #fff 100%); }
.stage-message {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: 11px;
  background: white;
  border: 1px solid #dbe4f0;
  color: #3b4a60;
  font-size: .91rem;
  font-weight: 650;
}
.disabled-section {
  opacity: .58;
  filter: grayscale(.12);
  pointer-events: none;
}
.disabled-section input,
.disabled-section textarea,
.disabled-section select {
  background: #eef1f5;
}
.compact-upload {
  margin: -4px 0 9px;
  padding: 9px 14px;
}
.resource-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.resource-columns h3,
.resource-columns h4 { margin: 8px 0 10px; }
.resource-list { display: grid; gap: 10px; }
.resource-card {
  padding: 13px;
  border: 1px solid #d9e1ec;
  border-radius: 14px;
  background: #fff;
}
.resource-card p { margin: 7px 0; }
.resource-card a { color: #1d4ed8; font-weight: 780; }
.resource-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.resource-type {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: .7rem;
  font-weight: 850;
}
.resource-inline {
  margin: 14px 0;
  padding: 13px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}
.resource-inline details { margin: 9px 0; }
.resource-inline summary { cursor: pointer; color: #1d4ed8; font-weight: 800; }
.resource-inline .resource-card { margin-top: 8px; background: white; }
.pill.route { background: #fff7ed; color: #9a3412; }
.output-stack { display: grid; gap: 20px; }
.instrument-output {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.instrument-box { min-height: 470px; }

@media (max-width: 900px) {
  .resource-columns { grid-template-columns: 1fr; }
}

/* Article-topic relevance and generation notes */
.warning-details {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #f2c68c;
  border-radius: 12px;
  background: #fff8ed;
  color: #7a3d08;
  font-size: .9rem;
}
.warning-details ul { margin: 8px 0 0 20px; padding: 0; }
.warning-details li { margin: 4px 0; }
.source-match {
  margin: 8px 0;
  padding: 7px 9px;
  border-radius: 9px;
  background: #f0fdf4;
  color: #166534;
  font-size: .78rem;
}
[hidden] { display: none !important; }

/* Article polishing and revision module */
.revision-layout { grid-template-columns: minmax(390px, .92fr) minmax(500px, 1.08fr); }
.revision-blue-note {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #075985;
  font-weight: 800;
}
.revision-focus-panel {
  margin: 18px 0;
  padding: 17px;
  border: 1px solid #bfdbfe;
  border-left: 5px solid #0070c0;
  border-radius: 18px;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
}
.revision-focus-panel h3 { margin-top: 0; }
.revision-focus-panel .check { margin: 10px 0 !important; }
.revision-output-panel { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; }
.revision-article-box { min-height: 760px; }
.revision-report-panel { padding-top: 22px; border-top: 1px solid var(--line); }
.revision-report-box { min-height: 480px; }
.revision-matrix-box { min-height: 320px; }
.status.error { color: #b42318; }

@media (min-width: 1050px) {
  .module-grid.three-modules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .revision-layout { grid-template-columns: 1fr; }
  .revision-output-panel { position: static; max-height: none; }
}


/* Integrated ProjectReady AI project and payment controls */
.project-link-card {
  max-width: 1420px;
  margin: 0 auto 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
  gap: 1rem 1.5rem;
  align-items: center;
}
.project-link-card .attached-summary { grid-column: 1 / -1; }
.project-connect-actions { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: end; }
.project-connect-actions label { grid-column: 1 / -1; }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .7rem 1rem;
  border-radius: 10px;
  background: #0b57d0;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.nav { flex-wrap: wrap; justify-content: flex-end; }
.nav a[aria-current="page"] { color: #0b57d0; font-weight: 800; }
.pr-access-panel-inline {
  margin: 1rem 0;
  padding: .9rem 1rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
}
@media (max-width: 850px) {
  .project-link-card { grid-template-columns: 1fr; }
  .project-connect-actions { grid-template-columns: 1fr; }
  .project-connect-actions label { grid-column: auto; }
}

.source-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 1rem;
}

.source-choice label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  font-weight: 650;
}

.recovery-box {
  margin-top: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  padding: 0.8rem 1rem;
}

.recovery-box summary {
  cursor: pointer;
  font-weight: 750;
  color: #1d4ed8;
}

.recovery-results {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.recovered-project {
  width: 100%;
  text-align: left;
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1e3a8a;
  padding: 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

.recovered-project:hover {
  background: #dbeafe;
}

#externalProjectPanel {
  margin-top: 0.7rem;
  border: 1px solid #c4b5fd;
  border-radius: 12px;
  background: #f5f3ff;
  padding: 1rem;
}


.academic-integrity-panel {
  border: 1px solid #b8c7ea;
  background: #f4f7ff;
  border-radius: 14px;
  padding: 15px 17px;
  margin: 20px 0;
}
.academic-integrity-panel h3 { margin-top: 0; color: #17366f; }
.academic-integrity-panel .check { background: #fff; border: 1px solid #d7def0; border-radius: 9px; padding: 10px; }

.alignment-box {
  border: 1px dashed #b9c7de;
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
  background: #f8fbff;
}

.alignment-box h3 {
  margin: 0 0 6px;
}


/* 2026-07-10: full ProjectReady navigation tabs on the Strengthener page. */
.nav {
  row-gap: .35rem;
}
.nav a {
  white-space: nowrap;
}
@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: .2rem;
  }
}

.developer-access-box {
  margin-top: 1rem;
  border: 1px dashed #b9c7ff;
  border-radius: 18px;
  background: #f8faff;
  padding: 1rem 1.15rem;
}

.developer-access-box summary {
  cursor: pointer;
  font-weight: 800;
  color: #2d44c8;
}

.developer-access-box p {
  color: #475569;
  margin-bottom: 0.8rem;
}

.developer-access-actions {
  align-items: end;
}


/* 2026-07-11: chapter/section scope and adjustable page targets. */
.scope-settings-panel,
.target-page-panel,
.section-scope-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #c8d5e8;
  border-radius: 18px;
  background: #fbfdff;
}
.target-page-panel { border-left: 5px solid var(--teal); }
.section-scope-panel { border-left: 5px solid var(--indigo); }
.section-scope-panel h3,
.custom-section-builder h4 { margin: 0 0 5px; }
.section-scope-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.section-count-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .8rem;
  font-weight: 850;
}
.section-action-legend,
.strengthener-section-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 110px;
  gap: 10px;
  align-items: center;
}
.section-action-legend {
  padding: 8px 10px;
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.strengthener-sections { display: grid; gap: 8px; }
.strengthener-section-row {
  padding: 11px 12px;
  border: 1px solid #d8e1ed;
  border-radius: 13px;
  background: white;
}
.strengthener-section-title strong { display: block; color: #1f2f49; }
.strengthener-section-title small { display: block; margin-top: 3px; color: #6b7280; line-height: 1.35; }
.section-action-check {
  display: flex !important;
  align-items: center;
  gap: 5px;
  margin: 0 !important;
  font-size: .86rem;
  font-weight: 700 !important;
}
.section-action-check input { width: auto; }
.custom-section-builder {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d9e1ec;
}
.custom-section-list { display: grid; gap: 8px; margin-top: 10px; }
.custom-section-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #c4b5fd;
  border-radius: 12px;
  background: #faf8ff;
}
.custom-section-row small { display: block; margin-top: 3px; color: #64748b; }
.compact-remove { padding: 7px 11px; white-space: nowrap; }
@media (max-width: 720px) {
  .section-action-legend { display: none; }
  .strengthener-section-row { grid-template-columns: 1fr 1fr; }
  .strengthener-section-title { grid-column: 1 / -1; }
  .section-scope-head,
  .custom-section-row { flex-direction: column; align-items: stretch; }
}

/* Commercial background-processing status */
.strengthener-job-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fafc;
}
.strengthener-job-panel[hidden] { display: none !important; }
.strengthener-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  text-transform: capitalize;
}
.strengthener-job-panel progress {
  display: block;
  width: 100%;
  height: .8rem;
  accent-color: #0f766e;
}
.strengthener-job-panel .help { margin: .7rem 0; }
