:root {
  --ink: #10243e;
  --navy: #0b1f33;
  --blue: #2f80ed;
  --blue-dark: #1764c0;
  --blue-pale: #eaf3ff;
  --green: #168a5b;
  --green-pale: #e8f7f0;
  --amber: #b86f00;
  --amber-pale: #fff4dd;
  --red: #c63f45;
  --surface: #ffffff;
  --background: #f5f7fb;
  --line: #d6deea;
  --muted: #52657d;
  --shadow: 0 18px 50px rgba(11, 31, 51, 0.12);
  --radius: 22px;
  --radius-small: 14px;
  --content: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body.chat-open {
  overflow: hidden;
}

a {
  color: var(--blue-dark);
}

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

button,
.button {
  min-height: 46px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(11, 31, 51, 0.97);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: var(--content);
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #fff;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: #bed6ed;
  font-size: 0.76rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 10px;
  color: #dceaf7;
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: #fff;
  background: transparent;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.phase-bar {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.phase-list {
  max-width: var(--content);
  margin: 0 auto;
  padding: 9px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  list-style: none;
}

.phase-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.phase-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--blue);
}

.container {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 66px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(47, 128, 237, 0.38), transparent 34%),
    radial-gradient(circle at 5% 100%, rgba(24, 166, 106, 0.26), transparent 34%),
    var(--navy);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 50px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #82e4b5;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 26px;
  color: #d3e4f3;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.meta-row,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-row {
  margin-bottom: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.pill.green {
  color: #075d3b;
  background: #baf2d6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 22px rgba(47, 128, 237, 0.23);
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}

.button:hover {
  background: var(--blue-dark);
}

.button.secondary {
  color: var(--ink);
  background: #fff;
  box-shadow: none;
}

.button.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.button.small {
  min-height: 40px;
  padding: 9px 13px;
  font-size: 0.88rem;
}

.hero-card {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.hero-card h2 {
  font-size: 1.3rem;
}

.hero-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.hero-card li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.hero-card li::before {
  content: counter(steps);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.section {
  padding: 62px 0;
}

.section.compact {
  padding: 38px 0;
}

.section.alt {
  background: #fff;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-heading h2,
.page-intro h1 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.section-heading p,
.page-intro > p {
  color: var(--muted);
  font-size: 1.08rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(11, 31, 51, 0.06);
}

.card h3 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1.2rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: var(--blue-pale);
  font-size: 1.2rem;
  font-weight: 900;
}

.card-link {
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(11, 31, 51, 0.12);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.workflow-step {
  position: relative;
  padding: 20px;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.workflow-step .time {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--blue-dark);
  font-size: 0.83rem;
  font-weight: 900;
}

.workflow-step h3 {
  margin-bottom: 6px;
}

.callout {
  padding: 18px 20px;
  border-left: 5px solid var(--blue);
  border-radius: 12px;
  background: var(--blue-pale);
}

.callout.green {
  border-color: var(--green);
  background: var(--green-pale);
}

.callout.amber {
  border-color: var(--amber);
  background: var(--amber-pale);
}

.callout p:last-child {
  margin-bottom: 0;
}

.page-main {
  min-height: 70vh;
  padding: 54px 0 80px;
}

.page-intro {
  margin-bottom: 28px;
}

.breadcrumbs {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 750;
}

.breadcrumbs a {
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  align-items: start;
  gap: 24px;
}

.sticky-panel {
  position: sticky;
  top: 126px;
}

.prompt-box {
  margin-bottom: 24px;
  padding: 24px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--navy);
}

.prompt-box .eyebrow {
  color: #82e4b5;
}

.prompt-box p:last-child {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.source-switch {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.source-link {
  min-height: 86px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 24px rgba(11, 31, 51, 0.06);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.source-link:hover {
  border-color: var(--blue);
  box-shadow: 0 14px 34px rgba(11, 31, 51, 0.11);
  transform: translateY(-2px);
}

.source-link strong,
.source-link small {
  display: block;
}

.source-link small {
  margin-top: 3px;
  color: var(--muted);
}

.source-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 900;
}

.source-icon.scan {
  background: var(--green);
}

#typed-transcription,
#redacted-scan {
  scroll-margin-top: 142px;
}

.essay-sheet {
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.essay-sheet h2 {
  color: var(--navy);
}

.scan-section {
  margin-top: 34px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.scan-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.scan-heading-row h2 {
  margin-bottom: 7px;
  color: var(--navy);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.scan-heading-row p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.scan-heading-row .button-row {
  flex: 0 0 auto;
}

.scan-privacy {
  margin-bottom: 22px;
}

.scan-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.scan-card {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--background);
}

.scan-card a {
  border-radius: 10px;
  display: block;
  overflow: hidden;
  background: #fff;
}

.scan-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 180ms ease;
}

.scan-card a:hover img {
  transform: scale(1.015);
}

.scan-card figcaption {
  padding: 10px 4px 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.essay-paragraph {
  margin-bottom: 1.35em;
  color: #1d314b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.82;
}

.evidence-sentence {
  border-radius: 4px;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.evidence-sentence:hover {
  background: #fff4c8;
}

.evidence-sentence.selected {
  background: #ffe08a;
  box-shadow: 0 0 0 3px #ffe08a;
}

.evidence-list {
  min-height: 122px;
  margin: 14px 0;
  padding-left: 22px;
}

.evidence-list li {
  margin-bottom: 10px;
}

.small-note,
.status-text {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-text {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-weight: 750;
}

.rubric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.rubric-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.rubric-card header {
  padding: 20px;
  color: #fff;
  background: var(--navy);
}

.rubric-card:nth-child(2) header {
  background: var(--green);
}

.rubric-card:nth-child(3) header {
  background: var(--amber);
}

.rubric-card header h2,
.rubric-card header p {
  margin: 0;
}

.rubric-card header p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.8);
}

.rubric-band {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.rubric-band h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.rubric-band p {
  margin: 0;
  color: var(--muted);
}

.form-card {
  margin-top: 26px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 24px;
}

.field > label,
.field > legend {
  display: block;
  margin-bottom: 9px;
  color: var(--navy);
  font-weight: 850;
}

fieldset.field {
  border: 0;
  padding: 0;
}

.field-help {
  margin: -3px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #b7c3d2;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.choice-row,
.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #b7c3d2;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.choice input:checked + span {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.2);
}

.choice input:focus-visible + span {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

.summary-box {
  padding: 20px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
}

.summary-box pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
}

.ai-comparison-card {
  overflow: hidden;
  border-color: #b8cfe6;
  background:
    linear-gradient(145deg, rgba(47, 128, 237, 0.055), transparent 34%),
    #fff;
}

.ai-comparison-card > h2 {
  max-width: 790px;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.ai-lead {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.05rem;
}

.ai-steps {
  margin: 24px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  counter-reset: ai-steps;
  list-style: none;
}

.ai-steps li {
  counter-increment: ai-steps;
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.ai-steps li::before {
  content: counter(ai-steps);
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.ai-steps strong,
.ai-steps span {
  display: block;
}

.ai-steps span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.ai-service-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: var(--background);
}

.ai-service-panel h3,
.ai-service-panel p {
  margin-bottom: 4px;
}

.button.ai-link.chatgpt {
  background: #087f68;
  box-shadow: 0 8px 22px rgba(8, 127, 104, 0.2);
}

.button.ai-link.claude {
  background: #a85035;
  box-shadow: 0 8px 22px rgba(168, 80, 53, 0.2);
}

.button.ai-link:hover {
  filter: brightness(0.92);
}

.prompt-preview {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.prompt-preview summary {
  padding: 14px 16px;
  color: var(--blue-dark);
  cursor: pointer;
  font-weight: 850;
}

.prompt-preview textarea {
  min-height: 360px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  color: #2f4055;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.ai-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ai-total-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ai-score-grid label,
.ai-total-grid label {
  color: var(--navy);
}

.ai-score-grid input,
.ai-total-grid input {
  margin-top: 8px;
}

.ai-reveal-fieldset {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.ai-summary {
  margin-top: 6px;
}

.privacy-fine-print {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.activity-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 24px;
}

.activity-tab {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.activity-tab[aria-selected="true"] {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.activity-panel[hidden] {
  display: none;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.verdict-card span {
  min-height: 92px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.verdict-card small {
  margin-top: 4px;
  font-weight: 600;
}

.char-count {
  margin-top: 4px;
  color: var(--muted);
  text-align: right;
  font-size: 0.82rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 430px));
  justify-content: center;
  gap: 28px;
}

.qr-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.qr-card img {
  width: min(100%, 320px);
  height: auto;
  margin: 8px auto 18px;
  display: block;
  image-rendering: pixelated;
}

.short-url {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 900;
  word-break: break-word;
}

.join-mode .site-header,
.join-mode .phase-bar,
.join-mode .site-footer {
  display: none;
}

.join-mode .page-main {
  min-height: 100vh;
  padding: 32px 0;
  display: grid;
  place-items: center;
}

.join-mode .page-intro {
  text-align: center;
}

.privacy-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--green-pale);
}

.privacy-strip strong {
  color: #075d3b;
}

.site-footer {
  padding: 36px 0;
  color: #bcd0e1;
  background: var(--navy);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff;
}

.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 110;
  min-height: 54px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 14px 32px rgba(11, 31, 51, 0.28);
  font-weight: 900;
  cursor: pointer;
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 120;
  width: min(390px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 120px));
  border: 1px solid var(--line);
  border-radius: 20px;
  display: none;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(11, 31, 51, 0.3);
}

.chat-panel.open {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: var(--navy);
}

.chat-header p,
.chat-header strong {
  margin: 0;
  display: block;
}

.chat-header p {
  color: #bdd1e1;
  font-size: 0.78rem;
}

.chat-close {
  width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.chat-messages {
  min-height: 180px;
  padding: 16px;
  overflow-y: auto;
  background: #f5f7fb;
}

.message {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(11, 31, 51, 0.08);
}

.message.user {
  margin-left: auto;
  color: #fff;
  background: var(--blue);
}

.quick-questions {
  padding: 10px 14px 2px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  background: #fff;
}

.quick-question {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue-dark);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.chat-form {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: #fff;
}

.chat-form input {
  min-width: 0;
}

.chat-form button {
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 900px) {
  .hero-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .scan-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .scan-gallery {
    grid-template-columns: 1fr;
  }

  .ai-service-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-grid,
  .rubric-grid {
    grid-template-columns: 1fr;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sticky-panel {
    position: static;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    padding: 12px 20px 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: var(--navy);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.18);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
  }
}

@media (max-width: 650px) {
  .container {
    width: min(calc(100% - 26px), var(--content));
  }

  .header-inner {
    padding-inline: 13px;
  }

  .brand small {
    display: none;
  }

  .phase-list {
    padding-inline: 13px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .phase-list li {
    justify-content: center;
    font-size: 0;
  }

  .phase-number {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .hero {
    padding: 46px 0;
  }

  .section,
  .page-main {
    padding: 42px 0 60px;
  }

  .workflow-grid,
  .verdict-grid,
  .qr-grid {
    grid-template-columns: 1fr;
  }

  .source-switch {
    grid-template-columns: 1fr;
  }

  .ai-steps,
  .ai-score-grid,
  .ai-total-grid {
    grid-template-columns: 1fr;
  }

  .activity-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .button-row .button {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
  }

  .chat-launcher {
    right: 12px;
    bottom: 12px;
  }

  .chat-panel {
    right: 8px;
    bottom: 76px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 92px);
  }
}

@media print {
  .site-header,
  .phase-bar,
  .site-footer,
  .chat-launcher,
  .chat-panel,
  .no-print,
  .sticky-panel {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .page-main,
  .section {
    padding: 0;
  }

  .container {
    width: 100%;
  }

  .card,
  .essay-sheet,
  .rubric-card,
  .form-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
