:root {
  --paper: #fbf8f1;
  --paper-deep: #f2ecdf;
  --ink: #21302c;
  --muted: #68736f;
  --teal: #166c65;
  --teal-dark: #0c514c;
  --teal-pale: #e3f0ec;
  --line: #d9d4c8;
  --warm: #a95f37;
  --red: #a53b35;
  --blue: #165f9e;
  --white: #fffefb;
  --shadow: 0 18px 45px rgba(34, 48, 44, 0.09);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  line-height: 1.55;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 108, 101, 0.25);
  outline-offset: 2px;
}
.site-header {
  height: 76px;
  padding: 0 max(24px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-block {
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 3px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  line-height: 1.1;
}
.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  /* Compensate for the PNG’s blank right edge so the visible gap is about 5px. */
  margin-inline-end: -5px;
}
.brand-copy strong,
.brand-company {
  display: block;
}
.brand-copy strong {
  font-size: 1.125rem;
}
.brand-company {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 450;
  line-height: 1.3;
}
.input-accordion {
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.input-accordion:last-of-type {
  border-bottom: 1px solid var(--line);
}
.input-accordion > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 0;
  list-style: none;
  cursor: pointer;
  font-weight: 680;
}
.input-accordion > summary::-webkit-details-marker {
  display: none;
}
.input-accordion > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(45deg);
  justify-self: center;
}
.input-accordion[open] > summary::after {
  transform: rotate(225deg);
}
.input-accordion > summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}
.accordion-content {
  padding: 8px 0 24px;
}
.accordion-content .compact-fields {
  margin-bottom: 0;
}
.input-accordion .field-state {
  font-weight: 450;
}
.page-shell {
  width: min(100% - 32px, 960px);
  margin: auto;
}
.hero {
  text-align: center;
  padding: 24px 12px 42px;
}
.hero .app-name {
  margin: 0 0 22px;
  color: var(--teal-dark);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.hero h1 {
  font:
    500 clamp(2.25rem, 6vw, 4.4rem)/1.03 Georgia,
    "Times New Roman",
    serif;
  max-width: 820px;
  margin: 10px auto 20px;
  letter-spacing: -0.025em;
}
.hero > p:last-child {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 650px;
  margin: auto;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 750;
  font-size: 0.72rem;
  color: var(--teal);
  margin: 0;
}
.stepper {
  list-style: none;
  padding: 0;
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 700px;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8a918e;
  font-size: 0.86rem;
  position: relative;
}
.stepper li:not(:last-child)::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
  margin: 0 12px;
}
.stepper span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.78rem;
}
.stepper .is-current,
.stepper .is-complete {
  color: var(--teal);
}
.stepper .is-current span {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.stepper .is-complete span {
  background: var(--teal-pale);
  border-color: var(--teal-pale);
}
.card {
  background: var(--white);
  border: 1px solid rgba(180, 170, 150, 0.5);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.step-panel {
  padding: clamp(24px, 5vw, 52px);
}
.section-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 34px;
}
.section-heading h2,
.result-hero h2,
.working-card h2,
.auth-card h2 {
  font:
    500 clamp(1.7rem, 4vw, 2.5rem)/1.12 Georgia,
    serif;
  margin: 7px 0 0;
}
.lead {
  color: var(--muted);
  margin: -17px 0 30px;
}
label {
  font-weight: 680;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.compact-fields {
  margin-bottom: 26px;
}
label {
  display: block;
  margin-bottom: 7px;
}
label span,
.criteria-heading p {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 450;
}
input,
textarea {
  width: 100%;
  border: 1px solid #c9c6bd;
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}
input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 108, 101, 0.1);
  outline: 0;
}
.source-block {
  border-top: 1px solid var(--line);
  padding-top: 25px;
  margin: 25px 0;
}
.upload-help {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 12px 0;
}
.upload-details {
  margin-top: 10px;
  color: var(--muted);
}
.label-row,
.file-row,
.form-actions,
.criteria-heading,
.confirmation-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.field-state {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 4px 10px;
}
.file-row {
  justify-content: flex-start;
  margin-top: 10px;
  color: var(--muted);
}
.file-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.file-button,
.quiet-button,
.text-button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 8px 13px;
  font-weight: 700;
}
.file-button {
  margin: 0;
  color: var(--teal);
}
.file-row small {
  font-size: 0.76rem;
}
.primary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(22, 108, 101, 0.17);
}
.primary-button:hover {
  background: var(--teal-dark);
}
.quiet-button:hover,
.file-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.text-button {
  border: 0;
  color: var(--teal);
  padding: 7px;
  background: transparent;
}
.form-actions {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 22px;
}
.form-actions p {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
}
.extract-warning,
.message {
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  background: #fff3db;
  color: #674715;
  font-size: 0.88rem;
}
.message {
  margin: 0 0 18px;
  border: 1px solid #ead3a9;
}
.message.error {
  background: #fff0ee;
  color: #7d2e29;
  border-color: #e5beba;
}
.message.success {
  background: var(--teal-pale);
  color: var(--teal-dark);
  border-color: #bcd8d1;
}
.auth-card {
  max-width: 600px;
  margin: 30px auto;
  padding: 36px;
}
.inline-action {
  display: flex;
  gap: 10px;
}
.criteria-heading {
  margin: 30px 0 12px;
}
.criteria-heading h3,
.conflict-panel h3 {
  margin: 0;
  font:
    600 1.2rem Georgia,
    serif;
}
.criteria-heading p {
  margin: 2px 0 0;
}
.criterion-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.criterion-id {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.remove-criterion {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-weight: 700;
}
.conflict-panel {
  margin-top: 28px;
  padding: 22px;
  background: #fff5e6;
  border: 1px solid #e7cda5;
  border-radius: 12px;
}
.conflict-panel ul {
  padding-left: 20px;
}
.confirmation-note {
  justify-content: flex-start;
  margin-top: 28px;
  padding: 16px;
  border-radius: 10px;
  background: var(--teal-pale);
}
.confirmation-note span {
  color: var(--muted);
}
.requirement-grid {
  margin-top: 20px;
}
.working-card {
  text-align: center;
  padding: 75px 24px;
}
.working-card p:last-child {
  color: var(--muted);
  max-width: 550px;
  margin: 15px auto 0;
}
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 23px;
  border: 3px solid var(--teal-pale);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 36px 40px;
  margin-bottom: 20px;
}
.result-hero p:last-child {
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 0;
}
.feedback-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(22px, 4vw, 38px);
  margin: 16px 0;
}
.feedback-section h2 {
  font:
    600 1.45rem Georgia,
    serif;
  margin: 0 0 20px;
}
.strength-list,
.task-list,
.steps-list {
  padding-left: 1.3rem;
}
.strength-list li {
  margin: 9px 0;
}
.checkbox-list {
  list-style: none;
  padding: 0;
}
.checkbox-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  margin: 14px 0;
}
.box {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  margin-top: 4px;
}
.optional {
  font-size: 0.7rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.corrections {
  margin: 10px 0 5px;
  padding-left: 12px;
  border-left: 2px solid var(--teal-pale);
}
.correction {
  margin: 9px 0;
}
.original {
  color: var(--red);
  text-decoration: line-through;
}
.replacement {
  color: var(--blue);
  text-decoration: underline;
  font-weight: 650;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th {
  text-align: left;
  background: var(--paper-deep);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
th,
td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  vertical-align: top;
}
.status {
  white-space: nowrap;
  font-weight: 750;
  color: var(--teal);
}
.mark-key {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  background: var(--paper-deep);
  padding: 14px;
  border-radius: 10px;
  font-size: 0.82rem;
}
.marked-draft {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    1rem/1.85 Georgia,
    serif;
  padding: 22px 2px;
}
.marked-draft del {
  color: var(--red);
  text-decoration-thickness: 1.5px;
}
.marked-draft ins {
  color: var(--blue);
  text-underline-offset: 3px;
  font-weight: 600;
}
.marked-draft sup {
  color: var(--warm);
  font:
    700 0.7rem Inter,
    sans-serif;
  margin-left: 2px;
}
.annotation-separator {
  color: var(--muted);
}
.notes {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.notes li {
  margin: 10px 0;
}
.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 50px;
}
.privacy-note {
  margin: 40px 0;
  padding: 24px 28px;
  border-left: 3px solid var(--teal);
  background: var(--teal-pale);
}
.privacy-note h2 {
  font:
    600 1.2rem Georgia,
    serif;
  margin: 0 0 5px;
}
.privacy-note p {
  color: #50625d;
  margin: 0;
  font-size: 0.88rem;
}
footer {
  border-top: 1px solid var(--line);
  padding: 25px max(24px, calc((100% - 1120px) / 2));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}
footer p {
  margin: 0;
  overflow-wrap: anywhere;
}
footer a {
  color: inherit;
  text-underline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.shake {
  animation: shake 0.25s linear 2;
}
@keyframes shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
@media (max-width: 700px) {
  .site-header {
    height: auto;
    min-height: 72px;
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand-copy strong {
    font-size: 1rem;
  }
  .brand-company {
    font-size: 0.625rem;
    white-space: nowrap;
  }
  #clear-session {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    padding: 8px 10px;
    min-height: 44px;
  }
  .file-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .upload-details {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .hero {
    padding-top: 24px;
  }
  .stepper b {
    display: none;
  }
  .stepper li:not(:last-child)::after {
    margin: 0 8px;
  }
  .step-panel {
    border-radius: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .section-heading,
  .form-actions,
  .result-hero,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .file-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .criterion-row {
    grid-template-columns: 1fr auto;
  }
  .criterion-id {
    grid-column: 1/-1;
    text-align: left;
  }
  .result-hero {
    padding: 28px;
  }
  .download-button {
    width: 100%;
  }
  footer {
    display: block;
    text-align: center;
  }
  footer p + p {
    margin-top: 5px;
  }
  .inline-action {
    flex-direction: column;
  }
  .requirement-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.extract-warning.error {
  background: #fff0ee;
  color: #7d2e29;
}
.extraction-warnings {
  margin: 7px 0 0;
  padding-left: 1.25rem;
}
.extraction-warnings li + li {
  margin-top: 5px;
}
.checkbox-item > input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: white;
  cursor: pointer;
}
.checkbox-item > input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: inset 0 0 0 3px white;
}
.checkbox-body > label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}
.task-detail {
  display: block;
  margin-top: 4px;
}
.corrections {
  list-style: none;
}
.correction {
  display: inline;
}
.small-note {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Approved-account access uses the same form and card styles as review input. */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-card {
  max-width: 560px;
  margin: 0 auto 32px;
}
.auth-card form {
  display: grid;
  gap: 12px;
}
.auth-card h2 {
  margin-top: 0;
}
.auth-card .primary-button {
  margin-top: 8px;
}
.approved-users {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}
.approved-user {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.approved-user p {
  margin: 0;
  overflow-wrap: anywhere;
}
.approved-user .account-status {
  color: var(--muted);
  font-size: 0.85rem;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#setup-link-panel p {
  margin: 8px 0;
}
@media (max-width: 700px) {
  .site-header:has(.header-actions button:not([hidden])) {
    height: auto;
  }
  .header-actions {
    margin-left: auto;
  }
  .header-actions .quiet-button {
    min-height: 44px;
    font-size: 0.8rem;
    padding: 8px;
  }
  #admin-panel .inline-action {
    align-items: stretch;
  }
}
