:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #1f2933;
  background: #f4f7f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

:root {
  --c3-bg: #171c18;
  --c3-panel: #f8f4eb;
  --c3-ink: #1d2923;
  --c3-sidebar: #1b342c;
  --c3-accent: #df684e;
  --c3-muted: #69766f;
  --c3-border: #d8d2c6;
  --c3-soft-accent: #f5ded4;
  --c3-radius-panel: 18px;
  --c3-radius-control: 12px;
  --c3-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.c3-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.c3-panel {
  border: 1px solid var(--c3-border);
  border-radius: var(--c3-radius-panel);
  background: var(--c3-panel);
  box-shadow: var(--c3-shadow);
}

.c3-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--c3-border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--c3-ink);
  font-size: 12px;
  font-weight: 700;
}

.c3-primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--c3-sidebar);
  color: var(--c3-panel);
  font-weight: 800;
  white-space: nowrap;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.narrow {
  max-width: 760px;
}

h1 {
  font-size: 28px;
  margin: 0 0 20px;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

nav {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

nav form {
  margin-left: auto;
}

a {
  color: #1557b0;
}

.button,
button {
  border: 1px solid #1557b0;
  background: #1557b0;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8ced8;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: white;
}

textarea {
  resize: vertical;
}

.error {
  color: #b3261e;
  font-weight: 600;
}

.metrics,
.actions,
.forms {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.metrics div,
article,
.inline {
  background: white;
  border: 1px solid #dde2ea;
  border-radius: 8px;
  padding: 14px;
}

.metrics strong {
  display: block;
  font-size: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  border-bottom: 1px solid #e3e7ee;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.filter {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.summary-meta div {
  background: white;
  border: 1px solid #dde2ea;
  border-radius: 8px;
  padding: 12px;
}

.summary-meta dt {
  color: #667085;
  font-weight: 700;
  margin-bottom: 4px;
}

.summary-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .page {
    padding: 18px;
  }

  .narrow {
    max-width: none;
  }

  h1 {
    font-size: 24px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  nav {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }

  nav a,
  nav button,
  .button,
  button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  nav form {
    margin-left: 0;
  }

  .button,
  button {
    padding: 10px 14px;
  }

  .filter,
  .actions,
  .forms,
  .metrics {
    align-items: stretch;
    flex-direction: column;
  }

  .filter button,
  .actions .button,
  .actions button,
  .forms button {
    width: 100%;
  }

  .metrics div,
  article,
  .inline,
  .summary-meta div {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  pre {
    max-height: 320px;
    font-size: 13px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    background: transparent;
  }

  thead {
    display: none;
  }

  tr {
    background: white;
    border: 1px solid #dde2ea;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
  }

  td {
    border-bottom: 1px solid #edf1f5;
    display: grid;
    gap: 6px;
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 9px 0;
    overflow-wrap: anywhere;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    color: #667085;
    font-weight: 700;
  }

  td:nth-child(1)::before {
    content: "编号";
  }

  td:nth-child(2)::before {
    content: "邮箱";
  }

  td:nth-child(3)::before {
    content: "来源";
  }

  td:nth-child(4)::before {
    content: "状态";
  }

  td:nth-child(5)::before {
    content: "下一步";
  }

  td:nth-child(6)::before {
    content: "提交时间";
  }
}

.intake-page {
  min-height: 100vh;
  --ink: #121715;
  --paper: #fffaf0;
  --cream: #f5efe3;
  --line: #1f2824;
  --teal: #2f6f68;
  --red: #c7472f;
  --gold: #d9b24c;
  --lime: #dfe95a;
  --hero-bg: #13231f;
  --hero-text: #fffaf0;
  --hero-muted: rgba(255, 250, 240, 0.82);
  --hero-faint: rgba(255, 250, 240, 0.72);
  --hero-rule: rgba(255, 250, 240, 0.34);
  --hero-rule-strong: rgba(255, 250, 240, 0.72);
  --hero-panel: rgba(255, 250, 240, 0.08);
  --hero-panel-line: rgba(255, 250, 240, 0.18);
  --hero-accent: #f3d17c;
  --surface: #fffdf8;
  --surface-soft: #fff8df;
  --surface-soft-border: #d8c9a4;
  --sheet-bg: #fffdf5;
  --sheet-rule: rgba(21, 24, 23, 0.055);
  --label: #7a3527;
  --tile-text: #5c4b25;
  --text-muted: #59635f;
  --text-soft: #6a746f;
  --input-bg: #fcfaf4;
  --input-border: #c9d2cc;
  --focus-ring: rgba(217, 178, 76, 0.26);
  --soft-section-line: #d8dfda;
  --hard-shadow: #0f1a17;
  --panel-shadow: rgba(17, 21, 19, 0.24);
  --page-grid: rgba(18, 23, 21, 0.04);
  --page-grid-soft: rgba(18, 23, 21, 0.03);
  background:
    linear-gradient(180deg, var(--hero-bg) 0, var(--hero-bg) 640px, transparent 640px),
    linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--cream);
}

.intake-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(0, 1.06fr);
  gap: 34px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 28px 50px;
}

.intake-intro {
  align-self: start;
  display: grid;
  gap: 22px;
  padding-top: 4px;
}

.studio-mark {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
  padding: 10px 0 12px;
  border-top: 1px solid var(--hero-rule-strong);
  border-bottom: 1px solid var(--hero-rule);
  color: var(--hero-text);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.studio-mark div {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.studio-mark > span {
  color: var(--hero-accent);
  white-space: nowrap;
}

.brand-symbol {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--hero-rule-strong);
  border-radius: 50%;
  color: var(--hero-bg);
  background: var(--hero-text);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 19px;
}

.eyebrow,
.step-label {
  margin: 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.intake-intro .eyebrow {
  color: var(--hero-accent);
}

.intake-intro h1 {
  margin: 0;
  color: var(--hero-text);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 50px;
  line-height: 1.06;
}

.lead {
  max-width: 610px;
  margin: 0;
  color: var(--hero-muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-actions span {
  color: var(--hero-faint);
  font-size: 14px;
}

.hero-cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hero-text);
  border-radius: 999px;
  background: var(--hero-text);
  color: var(--hero-bg);
  font-weight: 800;
  padding: 10px 18px;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.proof-grid div {
  min-width: 0;
  border: 1px solid var(--hero-panel-line);
  border-radius: 8px;
  background: var(--hero-panel);
  padding: 13px 12px;
}

.proof-grid strong,
.proof-grid span {
  display: block;
}

.proof-grid strong {
  color: var(--hero-text);
  font-size: 15px;
  margin-bottom: 6px;
}

.proof-grid span {
  color: var(--hero-faint);
  font-size: 13px;
  line-height: 1.55;
}

.path-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--hard-shadow);
}

.path-flow div {
  position: relative;
  min-width: 0;
  padding: 13px 12px 14px;
}

.path-flow div + div {
  border-left: 1px solid var(--line);
}

.path-flow div + div::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--paper);
  transform: translateY(-50%) rotate(45deg);
}

.path-flow span,
.path-flow strong {
  display: block;
}

.path-flow span {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
}

.path-flow strong {
  color: var(--ink);
  font-size: 15px;
  margin-top: 5px;
}

.trust-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
}

.trust-list li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--soft-section-line);
}

.trust-list strong {
  color: var(--ink);
  font-size: 16px;
}

.trust-list span {
  color: var(--text-muted);
  line-height: 1.55;
}

.report-preview {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px 22px 22px;
  box-shadow: 10px 10px 0 var(--hard-shadow);
}

.report-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background: linear-gradient(90deg, var(--red) 0 28%, var(--gold) 28% 61%, var(--teal) 61% 100%);
}

.preview-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.preview-topline span {
  border: 1px solid var(--surface-soft-border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 5px 10px;
}

.report-preview h2 {
  margin: 16px 0 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 24px;
}

.sample-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.sample-meta span {
  min-width: 0;
  border: 1px solid var(--surface-soft-border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--tile-text);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 6px;
  text-align: center;
}

.diagnosis-sheet {
  display: grid;
  border: 1px solid var(--line);
  margin: 0 0 16px;
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, var(--sheet-rule) 32px),
    var(--sheet-bg);
}

.diagnosis-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 13px 12px;
}

.diagnosis-row + .diagnosis-row {
  border-top: 1px solid var(--line);
}

.diagnosis-row span {
  display: block;
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.diagnosis-row strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.preview-note {
  margin: -4px 0 16px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.sample-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.75;
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.value-strip span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--lime);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 6px;
  text-align: center;
}

.intake-form-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 64px var(--panel-shadow);
}

.intake-form-panel::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--red), var(--gold), var(--teal));
}

.form-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.form-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 28px;
}

.form-heading p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.form-ticket {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--surface-soft-border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--tile-text);
  margin-bottom: 6px;
  padding: 10px 12px;
}

.form-ticket span,
.form-ticket strong {
  min-width: 0;
  font-size: 13px;
}

.form-ticket strong {
  color: var(--red);
  text-align: center;
}

.form-ticket span:last-child {
  text-align: right;
}

.intake-form {
  gap: 0;
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 24px 0 26px;
  border-top: 1px solid var(--soft-section-line);
}

.section-heading {
  display: grid;
  gap: 6px;
}

.section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.section-heading p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.form .field {
  font-weight: 400;
}

.field-title {
  color: var(--ink);
  font-weight: 700;
}

.field-title em {
  color: var(--red);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.field-help {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.intake-form input,
.intake-form select,
.intake-form textarea {
  width: 100%;
  border-color: var(--input-border);
  background: var(--input-bg);
  color: var(--ink);
  line-height: 1.5;
}

.intake-form input:focus,
.intake-form select:focus,
.intake-form textarea:focus {
  outline: 3px solid var(--focus-ring);
  border-color: var(--teal);
  background: var(--surface);
}

.intake-form ::placeholder {
  color: var(--text-soft);
}

.submit-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--soft-section-line);
}

.submit-row p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.submit-row button {
  min-width: 168px;
  border-color: var(--ink);
  background: var(--ink);
  padding: 12px 18px;
  font-weight: 700;
  box-shadow: 0 12px 28px var(--panel-shadow);
}

.submit-row button:hover {
  background: var(--red);
  border-color: var(--red);
}

@media (max-width: 900px) {
  .intake-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 18px 34px;
  }

  .intake-page {
    background:
      linear-gradient(180deg, var(--hero-bg) 0, var(--hero-bg) 820px, transparent 820px),
      linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 42px 42px,
      linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 42px 42px,
      var(--cream);
  }

  .intake-intro {
    padding-top: 0;
  }

  .intake-intro h1 {
    font-size: 34px;
  }

  .proof-grid,
  .path-flow {
    grid-template-columns: 1fr;
  }

  .path-flow div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .path-flow div + div::before {
    left: 22px;
    top: -6px;
    transform: rotate(135deg);
  }

  .intake-form-panel {
    padding: 22px 18px;
  }

  .intake-form-panel::before {
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    width: auto;
    height: 5px;
    border-radius: 8px 8px 0 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-row button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .studio-mark {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .trust-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .value-strip {
    grid-template-columns: 1fr;
  }

  .sample-meta,
  .form-ticket {
    grid-template-columns: 1fr;
  }

  .form-ticket strong,
  .form-ticket span:last-child {
    text-align: left;
  }

  .diagnosis-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.intake-page {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(132deg, var(--hero-bg) 0 46%, transparent 46.2%),
    linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--cream);
}

.intake-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(118deg, transparent 0 38px, rgba(255, 250, 240, 0.07) 39px 40px),
    repeating-linear-gradient(118deg, transparent 0 96px, rgba(18, 23, 21, 0.05) 97px 98px);
  opacity: 0.28;
}

.intake-shell {
  position: relative;
  z-index: 1;
}

.hero-stage {
  position: relative;
  min-height: 720px;
  padding: 30px 28px 110px;
  color: var(--hero-text);
}

.hero-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 150px;
  background: linear-gradient(168deg, transparent 0 48%, var(--cream) 48.5%);
  pointer-events: none;
}

.studio-toolbar,
.hero-grid,
.proof-grid,
.diagnosis-band,
.intake-workbench {
  max-width: 1240px;
  margin-inline: auto;
}

.studio-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, auto);
  gap: 22px;
  align-items: start;
}

.studio-toolbar .studio-mark {
  margin: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.97fr);
  gap: 48px;
  align-items: center;
  padding-top: 76px;
}

.hero-copy {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: 60px;
  line-height: 0.98;
}

.hero-copy .lead {
  max-width: 690px;
  font-size: 18px;
}

.hero-cta {
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.26);
  transform: translateY(-2px);
}

.route-console {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--hero-rule);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255, 250, 240, 0.14), rgba(255, 250, 240, 0.04)),
    rgba(0, 0, 0, 0.08);
  box-shadow: 18px 24px 70px rgba(0, 0, 0, 0.26);
  padding: 22px;
}

.route-console::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 0 62%, rgba(255, 250, 240, 0.12) 62% 63%, transparent 63%),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(255, 250, 240, 0.08) 31px);
  opacity: 0.62;
}

.console-topline,
.route-map,
.console-metrics {
  position: relative;
  z-index: 1;
}

.console-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--hero-faint);
  font-size: 13px;
  font-weight: 700;
}

.console-topline span:last-child {
  color: var(--hero-accent);
}

.route-map {
  position: relative;
  height: 240px;
  margin-top: 30px;
  border: 1px solid var(--hero-panel-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.06) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(255, 250, 240, 0.045) 1px, transparent 1px) 0 0 / 36px 36px;
}

.route-beam {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 50%;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 250, 240, 0.2);
  transform: translateY(-50%);
}

.route-beam::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24%;
  right: 24%;
  background: linear-gradient(90deg, transparent, var(--hero-accent), transparent);
}

.route-node {
  position: absolute;
  display: grid;
  gap: 4px;
  width: 112px;
  min-height: 72px;
  place-items: center;
  border: 1px solid var(--hero-rule);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.12);
  color: var(--hero-text);
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.route-node::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 10px;
  opacity: 0.42;
}

.route-node strong {
  font-size: 17px;
}

.route-node span {
  color: var(--hero-faint);
  font-size: 12px;
  font-weight: 700;
}

.node-one {
  left: 7%;
  top: 30%;
}

.node-two {
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
}

.node-three {
  right: 7%;
  bottom: 20%;
}

.console-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.console-metrics div {
  min-width: 0;
  border: 1px solid var(--hero-panel-line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.08);
  padding: 12px 10px;
}

.console-metrics span,
.console-metrics strong {
  display: block;
}

.console-metrics span {
  color: var(--hero-faint);
  font-size: 12px;
  margin-bottom: 6px;
}

.console-metrics strong {
  color: var(--hero-text);
  font-size: 13px;
}

.hero-stage .proof-grid {
  position: relative;
  z-index: 1;
  margin-top: 52px;
}

.hero-stage .proof-grid div {
  transform: translateY(0);
  transition: border-color 120ms ease, background 120ms ease;
}

.hero-stage .proof-grid div:hover {
  border-color: var(--hero-rule-strong);
  background: rgba(255, 250, 240, 0.12);
}

.diagnosis-band {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 26px;
  align-items: stretch;
  margin-top: -90px;
  padding: 0 28px 54px;
}

.diagnosis-band .path-flow {
  align-self: stretch;
  grid-template-columns: 1fr;
  min-height: 100%;
  background: var(--paper);
  box-shadow: 12px 14px 0 var(--hard-shadow);
}

.diagnosis-band .path-flow div {
  display: grid;
  align-content: center;
  min-height: 90px;
}

.diagnosis-band .path-flow div + div {
  border-left: 0;
  border-top: 1px solid var(--line);
}

.diagnosis-band .path-flow div + div::before {
  left: 28px;
  top: -6px;
  transform: rotate(135deg);
}

.diagnosis-band .report-preview {
  min-height: 100%;
  box-shadow: 18px 20px 0 var(--hard-shadow);
}

.intake-workbench {
  position: relative;
  z-index: 1;
  margin-bottom: 66px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0, transparent 18px, rgba(255, 255, 255, 0.32) 18px 22px, transparent 22px),
    var(--surface);
  box-shadow: 0 26px 72px var(--panel-shadow);
}

.intake-workbench::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--teal), var(--lime));
}

.intake-workbench .form-heading {
  grid-template-columns: minmax(220px, 0.84fr) minmax(0, 1.16fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 20px;
}

.intake-workbench .form-heading h2 {
  font-size: 34px;
}

.intake-workbench .form-ticket {
  border-style: dashed;
}

.intake-workbench .form-section {
  position: relative;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  gap: 28px;
}

.intake-workbench .section-heading {
  align-content: start;
}

.intake-workbench .section-heading h3 {
  font-size: 20px;
}

.intake-workbench .field {
  transition: none;
}

.intake-workbench .field:focus-within {
  transform: none;
}

.intake-form input,
.intake-form select,
.intake-form textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.intake-form input:focus,
.intake-form select:focus,
.intake-form textarea:focus {
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.07);
}

.submit-row button {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.submit-row button:hover,
.submit-row button:focus-visible {
  box-shadow: 0 18px 34px var(--panel-shadow);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1020px) {
  .studio-toolbar {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 54px;
  }

  .route-console {
    min-height: 380px;
  }

  .diagnosis-band {
    grid-template-columns: 1fr;
  }

  .diagnosis-band .path-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .diagnosis-band .path-flow div {
    min-height: 0;
  }

  .diagnosis-band .path-flow div + div {
    border-left: 1px solid var(--line);
    border-top: 0;
  }

  .diagnosis-band .path-flow div + div::before {
    left: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
  }

  .intake-workbench .form-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .intake-page {
    background:
      linear-gradient(148deg, var(--hero-bg) 0 52%, transparent 52.4%),
      linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 42px 42px,
      linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 42px 42px,
      var(--cream);
  }

  .hero-stage {
    min-height: auto;
    padding: 24px 18px 88px;
  }

  .hero-stage::after {
    height: 110px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-stage .proof-grid {
    grid-template-columns: 1fr;
  }

  .diagnosis-band {
    margin-top: -58px;
    padding: 0 18px 36px;
  }

  .intake-workbench {
    margin-inline: 18px;
    padding: 24px 18px;
  }

  .intake-workbench .form-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 620px) {
  .studio-toolbar .studio-mark {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .route-console {
    min-height: 350px;
    padding: 18px;
  }

  .route-map {
    height: 220px;
  }

  .route-node {
    width: 92px;
    min-height: 64px;
  }

  .node-one {
    left: 3%;
  }

  .node-three {
    right: 3%;
  }

  .console-metrics,
  .diagnosis-band .path-flow,
  .sample-meta,
  .form-ticket,
  .value-strip {
    grid-template-columns: 1fr;
  }

  .diagnosis-band .path-flow div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .diagnosis-band .path-flow div + div::before {
    left: 22px;
    top: -6px;
    transform: rotate(135deg);
  }

  .form-ticket strong,
  .form-ticket span:last-child {
    text-align: left;
  }
}

/* Public intake: form first, short context, no continuous animation. */
.intake-page {
  background:
    linear-gradient(118deg, var(--hero-bg) 0 38%, transparent 38.2%),
    linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--cream);
}

.intake-page::before {
  background:
    repeating-linear-gradient(112deg, transparent 0 54px, rgba(255, 250, 240, 0.08) 55px 56px),
    repeating-linear-gradient(112deg, transparent 0 140px, rgba(18, 23, 21, 0.045) 141px 142px);
  opacity: 0.22;
}

.intake-start {
  min-height: 100vh;
  padding: 28px 28px 52px;
}

.form-first-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: 24px;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

.form-first-grid .intake-workbench {
  max-width: none;
  margin: 0;
  padding: 26px;
}

.form-heading-compact {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.form-heading-compact h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 42px;
  line-height: 1.08;
}

.form-heading-compact p {
  font-size: 15px;
  line-height: 1.65;
}

.form-first-grid .form-ticket {
  margin-bottom: 2px;
}

.form-first-grid .form-section {
  grid-template-columns: minmax(160px, 0.32fr) minmax(0, 1fr);
  gap: 14px 24px;
  padding: 20px 0 22px;
}

.form-first-grid .section-heading {
  grid-column: 1;
  grid-row: 1 / span 8;
  align-content: start;
}

.form-first-grid .section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.form-first-grid .section-heading p {
  font-size: 14px;
  line-height: 1.55;
}

.form-first-grid .form-section > .field,
.form-first-grid .form-section > .field-grid {
  grid-column: 2;
}

.form-first-grid .field-grid {
  gap: 12px;
}

.form-first-grid .field {
  gap: 6px;
}

.form-first-grid .field-help {
  font-size: 13px;
}

.form-first-grid textarea {
  min-height: 112px;
}

.invite-page {
  min-height: 100vh;
  background:
    linear-gradient(118deg, rgba(210, 177, 78, 0.95) 0 1px, transparent 1px 100%) 50% 50% / 100% 100% no-repeat,
    linear-gradient(118deg, #111917 0 49.4%, #d4b252 49.45% 49.9%, #f4efe5 50% 100%);
  color: #111917;
}

.invite-shell {
  width: min(520px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 36px 0;
}

.invite-hero {
  color: #fffaf0;
  display: grid;
  gap: 14px;
  max-width: 460px;
}

.invite-hero p {
  margin: 0;
  color: #d4b252;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.invite-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 64px;
  line-height: 0.98;
}

.invite-hero span {
  width: fit-content;
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.82);
  font-weight: 800;
  padding: 8px 12px;
}

.invite-card {
  width: 100%;
  border: 1px solid rgba(17, 25, 23, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 18px 18px 0 rgba(17, 25, 23, 0.16), 0 26px 72px rgba(17, 25, 23, 0.14);
  padding: clamp(24px, 5vw, 42px);
}

.invite-card h1 {
  margin: 0 0 10px;
  color: #111917;
  font-size: 40px;
  line-height: 1.02;
}

.invite-card p {
  color: #52605a;
  line-height: 1.75;
  margin: 0 0 18px;
}

.invite-form {
  display: grid;
  gap: 16px;
}

.invite-form button {
  width: 100%;
}

@media (max-width: 760px) {
  .invite-page {
    background:
      linear-gradient(151deg, #111917 0 34%, #d4b252 34.2% 34.8%, #f4efe5 35% 100%);
  }

  .invite-shell {
    min-height: 100svh;
    align-content: center;
    padding: 26px 0;
  }

  .invite-card {
    box-shadow: 10px 10px 0 rgba(17, 25, 23, 0.16), 0 20px 44px rgba(17, 25, 23, 0.12);
  }
}

.start-copy {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 22px;
  box-shadow: 10px 10px 0 var(--hard-shadow);
}

.start-copy .eyebrow {
  color: var(--red);
}

.start-copy h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 25px;
  line-height: 1.2;
}

.start-copy .lead {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.start-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.start-points span,
.mini-flow span {
  min-width: 0;
  border: 1px solid var(--surface-soft-border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--tile-text);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 6px;
  text-align: center;
}

.start-mini {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--soft-section-line);
  padding-top: 16px;
}

.start-mini strong {
  color: var(--ink);
  font-size: 14px;
}

.mini-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

@media (max-width: 980px) {
  .intake-page {
    background:
      linear-gradient(180deg, var(--hero-bg) 0 96px, transparent 96px),
      linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 40px 40px,
      linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 40px 40px,
      var(--cream);
  }

  .intake-start {
    padding: 18px 16px 36px;
  }

  .form-first-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 0;
  }

  .form-first-grid .intake-workbench {
    order: 1;
    margin-inline: 0;
    padding: 22px 18px;
  }

  .start-copy {
    position: static;
    order: 2;
    box-shadow: 6px 6px 0 var(--hard-shadow);
  }

  .form-heading-compact {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .form-heading-compact h1 {
    font-size: 32px;
  }

  .form-first-grid .form-section {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-first-grid .section-heading,
  .form-first-grid .form-section > .field,
  .form-first-grid .form-section > .field-grid {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 620px) {
  .start-points,
  .mini-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Admin workspace */
.admin-page {
  min-height: 100vh;
  color: #1d2924;
  background:
    linear-gradient(90deg, rgba(29, 41, 36, 0.035) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(29, 41, 36, 0.025) 1px, transparent 1px) 0 0 / 36px 36px,
    #eef2ef;
}

.admin-page a {
  color: inherit;
}

.admin-page button,
.admin-page .button,
.admin-primary-link,
.admin-row-action {
  min-height: 38px;
  border: 1px solid #17221e;
  border-radius: 8px;
  background: #17221e;
  color: #fffaf0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  font-weight: 700;
  text-decoration: none;
}

.admin-page button:hover,
.admin-page .button:hover,
.admin-primary-link:hover,
.admin-row-action:hover {
  background: #2f6f68;
  border-color: #2f6f68;
}

.admin-page .button-secondary {
  background: #fffdf8;
  color: #17221e;
}

.admin-page .button-secondary:hover {
  color: #fffaf0;
}

.readonly-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.readonly-report {
  margin-top: 18px;
}

.invite-code-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #f6f8f4;
  color: #17221e;
  font-weight: 800;
  padding: 5px 8px;
  text-decoration: none;
}

.invite-code-link:hover {
  border-color: #2f6f68;
  color: #2f6f68;
}

.invite-generate-panel,
.invite-filter-panel {
  margin-bottom: 18px;
}

.invite-generate-form {
  grid-template-columns: minmax(120px, 160px) minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  align-items: end;
}

.generated-codes {
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #f6f8f4;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
}

.generated-codes strong {
  color: #17221e;
}

.generated-codes div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.generated-codes code,
.invite-table-code {
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  color: #17221e;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 6px 8px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(255, 250, 240, 0.12);
  background: #17221e;
  color: #fffaf0;
  padding: 20px 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fffaf0;
  text-decoration: none;
}

.admin-brand span,
.admin-login-brand span {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 250, 240, 0.45);
  border-radius: 50%;
  background: #fffaf0;
  color: #17221e;
  display: inline-grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 20px;
  font-weight: 700;
}

.admin-brand strong {
  font-size: 17px;
}

.admin-nav {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

.admin-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 250, 240, 0.78);
  padding: 10px 11px;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(255, 250, 240, 0.1);
  color: #fffaf0;
}

.admin-logout {
  margin-top: auto;
}

.admin-logout button {
  width: 100%;
  border-color: rgba(255, 250, 240, 0.22);
  background: transparent;
  color: #fffaf0;
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.admin-header p,
.admin-panel-head p,
.admin-login-brand p {
  margin: 0 0 5px;
  color: #7b8580;
  font-size: 13px;
  font-weight: 700;
}

.admin-header h1,
.admin-panel-head h2,
.admin-login-brand h1 {
  margin: 0;
  color: #17221e;
  font-size: 28px;
  line-height: 1.15;
}

.admin-header-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px 12px;
}

.admin-header-meta strong {
  font-size: 28px;
}

.admin-id {
  display: block;
  color: #65736d;
  font-size: 13px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat {
  min-height: 108px;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  display: grid;
  align-content: space-between;
  padding: 15px;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(23, 34, 30, 0.07);
}

.admin-stat:hover {
  border-color: #17221e;
}

.admin-stat span {
  color: #64726c;
  font-weight: 700;
}

.admin-stat strong {
  color: #17221e;
  font-size: 34px;
  line-height: 1;
}

.admin-stat-total {
  background: #17221e;
  color: #fffaf0;
}

.admin-stat-total span,
.admin-stat-total strong {
  color: #fffaf0;
}

.admin-dashboard-grid,
.detail-grid,
.admin-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
}

.admin-detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
  align-items: start;
}

.admin-workflow {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-panel,
.admin-table-panel,
.admin-login-card {
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 16px 42px rgba(23, 34, 30, 0.08);
}

.admin-panel {
  padding: 18px;
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-panel-head h2 {
  font-size: 20px;
}

.admin-list-stack {
  display: grid;
  gap: 9px;
}

.admin-work-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e4e9e5;
  border-radius: 8px;
  background: #fbfcf8;
  padding: 10px;
  text-decoration: none;
}

.admin-work-item:hover {
  border-color: #2f6f68;
}

.admin-work-item strong,
.admin-work-item small,
.admin-work-item time {
  display: block;
}

.admin-work-item strong {
  overflow: hidden;
  color: #17221e;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-work-item small,
.admin-work-item time {
  color: #64726c;
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7ded9;
  border-radius: 999px;
  background: #f4f7f5;
  color: #34423c;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.status-warning {
  border-color: #e0c577;
  background: #fff6d9;
  color: #6b4f00;
}

.status-danger {
  border-color: #df9d94;
  background: #fff0ed;
  color: #963525;
}

.status-info {
  border-color: #9fc4d3;
  background: #edf8fb;
  color: #23596c;
}

.status-success {
  border-color: #9ec7ad;
  background: #edf8f0;
  color: #246139;
}

.status-accent {
  border-color: #d9b24c;
  background: #fff5d6;
  color: #76550f;
}

.admin-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto auto;
  gap: 12px;
  align-items: end;
}

.admin-filter label,
.admin-form label {
  display: grid;
  gap: 7px;
  color: #34423c;
  font-weight: 700;
}

.admin-filter label span {
  color: #64726c;
  font-size: 13px;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  border-color: #cdd6d0;
  border-radius: 8px;
  background: #fbfcf8;
  color: #17221e;
}

.admin-page input:focus,
.admin-page select:focus,
.admin-page textarea:focus {
  border-color: #2f6f68;
  outline: 3px solid rgba(47, 111, 104, 0.16);
}

.admin-subtle-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64726c;
  font-weight: 700;
  text-decoration: none;
}

.admin-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-status-tabs a {
  border: 1px solid #d7ded9;
  border-radius: 999px;
  background: #fbfcf8;
  color: #34423c;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  font-weight: 700;
  text-decoration: none;
}

.admin-status-tabs a.is-active {
  border-color: #17221e;
  background: #17221e;
  color: #fffaf0;
}

.admin-status-tabs span {
  color: inherit;
  opacity: 0.72;
}

.admin-table-panel {
  overflow: hidden;
}

.admin-table-caption {
  display: flex;
  align-items: baseline;
  gap: 5px;
  border-bottom: 1px solid #e5ebe7;
  background: #f6f8f4;
  color: #64726c;
  padding: 12px 14px;
}

.admin-table-caption strong {
  color: #17221e;
  font-size: 22px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e5ebe7;
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #f6f8f4;
  color: #64726c;
  font-size: 12px;
  font-weight: 800;
}

.admin-table td::before {
  content: none !important;
}

.admin-table tr:hover td {
  background: #fbfcf8;
}

.admin-user-cell,
.admin-source-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-user-cell strong,
.admin-source-cell span {
  color: #17221e;
  font-weight: 800;
}

.admin-user-cell span,
.admin-user-cell small,
.admin-source-cell small,
.admin-next-action {
  color: #64726c;
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.progress-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
}

.progress-pills span {
  border: 1px dashed #cfd8d2;
  border-radius: 999px;
  color: #7a8580;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}

.progress-pills span.is-done {
  border-style: solid;
  border-color: #2f6f68;
  background: #edf8f0;
  color: #246139;
}

.detail-header {
  align-items: flex-start;
}

.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-summary div {
  min-width: 0;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  padding: 13px;
}

.detail-summary span,
.detail-summary strong {
  display: block;
}

.detail-summary span {
  color: #64726c;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.detail-summary strong {
  color: #17221e;
  overflow-wrap: anywhere;
}

.document-panel {
  min-width: 0;
}

.admin-doc {
  border: 1px solid #e4e9e5;
  border-radius: 8px;
  background: #fbfcf8;
  margin-top: 10px;
  overflow: hidden;
}

.admin-doc summary {
  cursor: pointer;
  color: #17221e;
  font-weight: 800;
  padding: 12px 14px;
}

.admin-doc pre {
  max-height: 460px;
  border-top: 1px solid #e4e9e5;
  border-radius: 0;
  background: #f6f8f4;
  color: #26342e;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  padding: 14px;
}

.admin-document {
  min-height: 56vh;
  max-height: 76vh;
  overflow: auto;
  border: 1px solid #e4e9e5;
  border-radius: 8px;
  background: #f6f8f4;
  color: #26342e;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
}

.admin-side-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form + .admin-form {
  border-top: 1px solid #e4e9e5;
  margin-top: 14px;
  padding-top: 14px;
}

.admin-form textarea {
  min-height: 90px;
}

.admin-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-hint,
.admin-notice {
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #f6f8f4;
  color: #48564f;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.admin-hint a {
  color: #2f6f68;
  font-weight: 800;
}

.admin-field-hint {
  display: block;
  color: #64726c;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
}

.admin-notice {
  border-color: #9ec7ad;
  background: #edf8f0;
  color: #246139;
  font-weight: 800;
  margin-bottom: 18px;
}

.admin-notice-error {
  border-color: #df9d94;
  background: #fff0ed;
  color: #963525;
}

.admin-timeline {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-timeline li {
  border-left: 3px solid #2f6f68;
  padding: 0 0 0 10px;
}

.admin-timeline strong,
.admin-timeline span,
.admin-timeline time {
  display: block;
}

.admin-timeline strong {
  color: #17221e;
}

.admin-timeline span,
.admin-timeline time {
  color: #64726c;
  font-size: 12px;
  line-height: 1.5;
}

.admin-edit-form {
  align-items: start;
}

.editor-panel textarea {
  min-height: 62vh;
  resize: vertical;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 14px;
  line-height: 1.65;
}

.config-panel {
  max-width: 940px;
}

.config-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-form textarea {
  min-height: 360px;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.65;
}

.config-form .field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.config-model-grid {
  align-items: start;
}

.config-control-field {
  align-content: start;
}

.config-control-field > input:not([type="hidden"]),
.config-control-field > select {
  height: 42px;
  min-height: 42px;
  line-height: 20px;
}

.config-model-hint {
  grid-column: 2;
  margin-top: -6px;
}

.model-candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.model-candidate-list code {
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  color: #17221e;
  font-size: 12px;
  padding: 5px 8px;
}

.model-probe-result {
  overflow-x: auto;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #f6f8f4;
  color: #48564f;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 12px;
  padding: 12px;
}

.model-candidate-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  margin-top: 10px;
}

.model-candidate-table th,
.model-candidate-table td {
  border-top: 1px solid #d7ded9;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.model-candidate-table th {
  color: #17221e;
  font-weight: 800;
}

.model-candidate-table code {
  color: #17221e;
  font-size: 12px;
}

.config-test-result {
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  padding: 14px;
}

.config-test-result h2,
.config-test-result h3 {
  margin: 0 0 10px;
}

.config-test-result h2 {
  font-size: 18px;
}

.config-test-result h3 {
  color: #48564f;
  font-size: 13px;
}

.config-test-result pre {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #f6f8f4;
  color: #17221e;
  line-height: 1.65;
  margin: 0 0 12px;
  padding: 12px;
  white-space: pre-wrap;
}

.report-preview-panel {
  overflow: hidden;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  margin: 0 0 12px;
  box-shadow: 0 14px 34px rgba(23, 34, 30, 0.07);
}

.report-preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e4e9e5;
  background:
    linear-gradient(90deg, rgba(47, 111, 104, 0.1), rgba(214, 168, 71, 0.12)),
    #f6f8f4;
  padding: 10px 14px;
}

.report-preview-toolbar span,
.report-preview-toolbar small {
  display: block;
}

.report-preview-toolbar span {
  color: #17221e;
  font-size: 13px;
  font-weight: 900;
}

.report-preview-toolbar small {
  color: #64726c;
  font-size: 12px;
  font-weight: 700;
}

.report-rendered {
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(214, 168, 71, 0.16) 0 5px, transparent 5px),
    #fffdf8;
  color: #26342e;
  display: block;
  font-size: 15px;
  line-height: 1.78;
  margin: 0;
  max-width: none;
  overflow-wrap: anywhere;
  padding: 26px 30px 30px 34px;
  box-shadow: none;
}

.report-rendered-formal {
  background:
    linear-gradient(90deg, #17221e 0 5px, transparent 5px),
    linear-gradient(180deg, rgba(214, 168, 71, 0.12), transparent 150px),
    #fffdf8;
  padding: 34px 42px 42px 46px;
}

.report-preview-compact .report-rendered {
  max-height: 560px;
  overflow: auto;
}

.readonly-report-preview .report-rendered {
  max-height: none;
}

.report-rendered h1,
.report-rendered h2,
.report-rendered h3,
.report-rendered h4 {
  color: #17221e;
  line-height: 1.28;
  margin: 0;
}

.report-rendered h1 {
  border-bottom: 2px solid #17221e;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 30px;
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.report-rendered h2 {
  border-top: 1px solid #d7ded9;
  font-size: 21px;
  margin-top: 28px;
  padding-top: 20px;
}

.report-rendered h3 {
  color: #2f6f68;
  font-size: 17px;
  margin-top: 20px;
}

.report-rendered h4 {
  font-size: 15px;
  margin-top: 16px;
}

.report-rendered p {
  margin: 12px 0 0;
}

.report-rendered blockquote {
  border-left: 4px solid #d6a847;
  border-radius: 0 8px 8px 0;
  background: #fff7de;
  color: #4d432c;
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 20px;
  padding: 13px 16px;
}

.report-rendered ul,
.report-rendered ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 24px;
}

.report-rendered li::marker {
  color: #2f6f68;
  font-weight: 900;
}

.report-rendered strong {
  color: #17221e;
}

.report-rendered code {
  border: 1px solid #e2d6b7;
  border-radius: 6px;
  background: #fff7de;
  color: #523d11;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 0.92em;
  padding: 1px 5px;
}

.report-table-wrap {
  overflow-x: auto;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  margin-top: 14px;
}

.report-rendered table {
  min-width: 680px;
  background: #fffdf8;
}

.report-rendered th,
.report-rendered td {
  border-bottom: 1px solid #e4e9e5;
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.report-rendered th {
  background: #f1f5f1;
  color: #34423c;
  font-size: 13px;
  font-weight: 900;
}

.report-rendered tr:last-child td {
  border-bottom: 0;
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.prompt-version-panel {
  position: sticky;
  top: 24px;
}

.prompt-preset-list {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid #e4e9e5;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.prompt-preset-list h3 {
  color: #17221e;
  font-size: 15px;
  margin: 0;
}

.prompt-preset-item {
  display: grid;
  gap: 10px;
  border: 1px solid #e4e9e5;
  border-radius: 8px;
  background: #fbfcf8;
  padding: 11px;
}

.prompt-preset-item strong,
.prompt-preset-item p {
  display: block;
}

.prompt-preset-item strong {
  color: #17221e;
  font-size: 14px;
}

.prompt-preset-item p {
  color: #64726c;
  font-size: 12px;
  line-height: 1.55;
  margin: 5px 0 0;
}

.prompt-preset-item form {
  margin: 0;
}

.prompt-preset-item button {
  min-height: 32px;
  padding: 6px 10px;
}

.prompt-version-list {
  display: grid;
  gap: 10px;
}

.prompt-version-item {
  display: grid;
  gap: 12px;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}

.prompt-version-item.is-active {
  border-color: #2f6f68;
  background: #f2faf5;
}

.prompt-version-item.is-selected {
  box-shadow: inset 4px 0 0 #d6a847;
}

.prompt-version-item strong,
.prompt-version-item span,
.prompt-version-item p {
  display: block;
}

.prompt-version-item strong {
  color: #17221e;
  font-size: 15px;
}

.prompt-version-item span {
  color: #64726c;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.prompt-version-item p {
  color: #48564f;
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.prompt-version-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.prompt-version-actions form {
  margin: 0;
}

.prompt-version-actions button,
.prompt-version-actions .admin-row-action {
  min-height: 32px;
  padding: 6px 10px;
}

.prompt-editor-panel {
  min-width: 0;
}

.prompt-form textarea[name="prompt_content"] {
  min-height: 56vh;
}

.prompt-test-source-grid {
  align-items: end;
}

.prompt-test-source-actions {
  display: grid;
  gap: 8px;
}

.prompt-test-source-actions span {
  color: #64726c;
  font-size: 13px;
  line-height: 1.5;
}

.prompt-test-source-actions button {
  width: fit-content;
}

.prompt-form textarea[name="test_intake_markdown"] {
  min-height: 220px;
}

.admin-empty {
  color: #64726c;
  margin: 0;
  padding: 12px;
}

.admin-login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.admin-login-card {
  width: min(420px, 100%);
  padding: 26px;
}

.admin-login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.admin-login-brand p {
  margin-bottom: 3px;
}

.admin-login-brand h1 {
  font-size: 30px;
}

@media (max-width: 1080px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .admin-nav {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
  }

  .admin-logout {
    margin-top: 0;
  }

  .admin-dashboard-grid,
  .detail-grid,
  .admin-detail-layout,
  .admin-edit-form,
  .invite-generate-form {
    grid-template-columns: 1fr;
  }

  .detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-layout {
    grid-template-columns: 1fr;
  }

  .prompt-version-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .admin-main {
    padding: 16px;
  }

  .admin-header,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-filter {
    grid-template-columns: 1fr;
  }

  .config-form .field-grid {
    grid-template-columns: 1fr;
  }

  .prompt-test-source-actions button {
    width: 100%;
  }

  .config-model-hint {
    grid-column: 1;
  }

  .admin-table,
  .admin-table thead,
  .admin-table tbody,
  .admin-table tr,
  .admin-table th,
  .admin-table td {
    display: block;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tr {
    border-bottom: 1px solid #d7ded9;
    padding: 12px;
  }

  .admin-table td {
    border-bottom: 0;
    padding: 7px 0;
  }

  .admin-table td::before {
    content: none !important;
  }

  .progress-pills {
    min-width: 0;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .detail-actions form,
  .detail-actions button,
  .admin-form-actions,
  .admin-form-actions button,
  .admin-primary-link,
  .admin-row-action,
  .admin-page button {
    width: 100%;
  }

  .admin-work-item {
    grid-template-columns: 1fr;
  }

  .report-preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-rendered,
  .report-rendered-formal {
    font-size: 14px;
    padding: 22px 18px 24px 22px;
  }

  .report-rendered h1 {
    font-size: 24px;
  }

  .report-rendered h2 {
    font-size: 18px;
  }

  .report-rendered table {
    display: table;
  }

  .report-rendered thead {
    display: table-header-group;
  }

  .report-rendered tbody {
    display: table-row-group;
  }

  .report-rendered tr {
    display: table-row;
    background: transparent;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
  }

  .report-rendered th,
  .report-rendered td {
    display: table-cell;
    border-bottom: 1px solid #e4e9e5;
    padding: 10px;
  }

  .report-rendered td::before {
    content: none !important;
  }
}

/* Final visual polish: premium public intake and focused admin workspace. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

h1,
h2,
h3,
h4,
p,
a,
button,
input,
select,
textarea,
label {
  letter-spacing: 0;
}

.intake-page {
  --ink: var(--c3-ink);
  --paper: var(--c3-panel);
  --cream: var(--c3-panel);
  --line: var(--c3-border);
  --teal: var(--c3-sidebar);
  --red: var(--c3-accent);
  --gold: var(--c3-accent);
  --lime: var(--c3-border);
  --hero-bg: var(--c3-bg);
  --hero-text: var(--c3-panel);
  --hero-muted: rgba(255, 250, 240, 0.78);
  --hero-faint: rgba(255, 250, 240, 0.62);
  --hero-rule: rgba(255, 250, 240, 0.24);
  --hero-rule-strong: rgba(255, 250, 240, 0.54);
  --hero-panel: rgba(255, 250, 240, 0.08);
  --hero-panel-line: rgba(255, 250, 240, 0.18);
  --hero-accent: var(--c3-accent);
  --surface: #fffdf8;
  --surface-soft: #f7f1df;
  --surface-soft-border: #dbcfaf;
  --sheet-bg: #fffdf7;
  --label: #763624;
  --tile-text: #4f452f;
  --text-muted: #5e6963;
  --text-soft: #7a837d;
  --input-bg: #fffdf8;
  --input-border: #d7ddd7;
  --focus-ring: rgba(44, 110, 103, 0.18);
  --soft-section-line: #dde2da;
  --hard-shadow: rgba(17, 26, 23, 0.82);
  --panel-shadow: rgba(17, 26, 23, 0.16);
  --page-grid: rgba(17, 26, 23, 0.045);
  --page-grid-soft: rgba(17, 26, 23, 0.03);
  color: var(--ink);
  background:
    linear-gradient(116deg, var(--hero-bg) 0 30%, rgba(17, 26, 23, 0.96) 30.1% 32%, transparent 32.1%),
    linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #f8f5ed 0, var(--cream) 100%);
}

.intake-page::before {
  background:
    repeating-linear-gradient(116deg, transparent 0 68px, rgba(255, 250, 240, 0.075) 69px 70px),
    repeating-linear-gradient(116deg, transparent 0 172px, rgba(17, 26, 23, 0.04) 173px 174px);
  opacity: 0.18;
}

.intake-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.44), transparent 36%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 18%, transparent 82%, rgba(17, 26, 23, 0.04));
}

.intake-shell,
.invite-shell,
.success-shell {
  position: relative;
  z-index: 1;
}

.invite-page {
  background:
    linear-gradient(124deg, rgba(216, 183, 101, 0.95) 0 1px, transparent 1px),
    linear-gradient(124deg, var(--c3-bg) 0 44%, var(--c3-accent) 44.05% 44.45%, var(--c3-panel) 44.55% 100%);
  color: var(--c3-ink);
}

.invite-shell,
.success-shell {
  width: min(560px, calc(100% - 36px));
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 38px 0;
}

.invite-card,
.success-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(17, 26, 23, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), transparent 170px),
    #fffdf8;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86) inset,
    0 28px 70px rgba(17, 26, 23, 0.18),
    12px 12px 0 rgba(17, 26, 23, 0.1);
  padding: 38px;
}

.invite-card::before,
.success-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--c3-accent);
}

.invite-card::after,
.success-card::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 118px;
  height: 118px;
  border-right: 1px solid rgba(17, 26, 23, 0.1);
  border-bottom: 1px solid rgba(17, 26, 23, 0.1);
  transform: skew(-10deg);
  pointer-events: none;
}

.invite-card h1,
.success-card h1 {
  margin: 8px 0 12px;
  color: var(--c3-ink);
  font-size: 38px;
  line-height: 1.12;
}

.invite-card p,
.success-card p {
  max-width: 460px;
  color: #59645f;
  line-height: 1.76;
  margin: 0 0 22px;
}

.invite-form {
  gap: 18px;
}

.invite-form .field {
  border: 1px solid #e0e5df;
  border-radius: 8px;
  background: #f8f6ee;
  padding: 12px;
}

.invite-form input {
  min-height: 56px;
  border-color: #cdd6cf;
  background: #fffdf8;
  color: var(--c3-ink);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.invite-form button,
.success-actions .button {
  min-height: 48px;
  border-color: var(--c3-sidebar);
  border-radius: 8px;
  background: var(--c3-sidebar);
  color: var(--c3-panel);
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(17, 26, 23, 0.18);
}

.success-page {
  min-height: 100vh;
}

.success-ticket {
  margin: 22px 0;
}

.success-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.success-secondary-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  color: var(--c3-ink);
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.intake-start {
  padding: 32px 30px 58px;
}

.form-first-grid {
  grid-template-columns: minmax(0, 1fr) minmax(274px, 330px);
  gap: 30px;
  max-width: 1320px;
}

.form-first-grid .intake-workbench {
  overflow: hidden;
  border-color: rgba(17, 26, 23, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), transparent 220px),
    linear-gradient(90deg, var(--c3-border) 0 1px, transparent 1px) 0 0 / 30px 30px,
    var(--surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 28px 74px rgba(17, 26, 23, 0.14);
  padding: 30px;
}

.form-first-grid .intake-workbench::before {
  height: 5px;
  background: var(--c3-accent);
}

.form-heading-compact {
  border-bottom: 1px solid var(--soft-section-line);
  margin-bottom: 14px;
  padding-bottom: 18px;
}

.form-heading-compact h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 36px;
  line-height: 1.14;
}

.form-heading-compact p {
  color: #5e6963;
  font-size: 15px;
}

.step-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-left: 3px solid var(--c3-accent);
  color: var(--c3-accent);
  font-size: 13px;
  padding-left: 9px;
}

.form-first-grid .form-ticket,
.success-ticket {
  border-color: var(--c3-border);
  background: var(--c3-soft-accent);
}

.form-ticket strong {
  color: var(--red);
  font-family: Consolas, "Microsoft YaHei", monospace;
}

.form-first-grid .form-section {
  border-top-color: #e4e8e2;
  padding: 24px 0;
}

.form-first-grid .section-heading {
  position: relative;
  padding-top: 4px;
}

.form-first-grid .section-heading::before {
  content: "";
  width: 30px;
  height: 2px;
  display: block;
  background: var(--gold);
  margin-bottom: 12px;
}

.form-first-grid .section-heading h2 {
  font-size: 18px;
  line-height: 1.35;
}

.form-first-grid .section-heading p {
  color: #66716b;
}

.form-first-grid .field {
  border: 1px solid rgba(215, 221, 215, 0.72);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
  padding: 11px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.form-first-grid .field:focus-within {
  border-color: rgba(44, 110, 103, 0.52);
  background: #fffdf8;
  box-shadow: 0 12px 24px rgba(17, 26, 23, 0.07);
}

.field-title {
  color: var(--c3-ink);
}

.field-help {
  color: #56635d;
}

.intake-form input,
.intake-form select,
.intake-form textarea {
  min-height: 43px;
  border-color: #cfd8d2;
  border-radius: 6px;
  background: #fffefa;
}

.intake-form textarea {
  line-height: 1.7;
}

.submit-row {
  border: 1px solid #e0e5df;
  border-radius: 8px;
  background: #f8f6ee;
  margin-top: 6px;
  padding: 14px;
}

.submit-row button {
  min-height: 48px;
  border-radius: 8px;
}

.start-copy {
  overflow: hidden;
  border-color: rgba(255, 250, 240, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.09), transparent 170px),
    var(--c3-sidebar);
  color: var(--c3-panel);
  box-shadow: 0 26px 60px rgba(17, 26, 23, 0.16);
}

.start-copy::before {
  content: "";
  height: 5px;
  display: block;
  margin: -22px -22px 14px;
  background: var(--c3-accent);
}

.start-copy .eyebrow {
  color: var(--hero-accent);
}

.start-copy h2 {
  color: var(--c3-panel);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 24px;
}

.start-copy .lead,
.start-mini strong {
  color: rgba(255, 250, 240, 0.78);
}

.start-mini {
  border-top-color: rgba(255, 250, 240, 0.16);
}

.start-points span,
.mini-flow span {
  border-color: rgba(255, 250, 240, 0.2);
  background: rgba(255, 250, 240, 0.08);
  color: rgba(255, 250, 240, 0.88);
}

.admin-page {
  --admin-ink: #121b18;
  --admin-muted: #66736d;
  --admin-line: #dce3dd;
  --admin-soft-line: #e9eee9;
  --admin-paper: #fffdf8;
  --admin-wash: #f3f1ea;
  --admin-green: #245f58;
  --admin-gold: #c79b43;
  min-height: 100vh;
  color: var(--admin-ink);
  background:
    linear-gradient(90deg, rgba(18, 27, 24, 0.045) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(0deg, rgba(18, 27, 24, 0.028) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(180deg, #f7f5ee 0, #ecefeb 100%);
}

.admin-shell {
  grid-template-columns: 246px minmax(0, 1fr);
}

.admin-sidebar {
  border-right: 1px solid rgba(255, 250, 240, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.08), transparent 260px),
    linear-gradient(112deg, transparent 0 68%, rgba(199, 155, 67, 0.18) 68.2% 68.6%, transparent 68.8%),
    #111a17;
  box-shadow: 8px 0 34px rgba(18, 27, 24, 0.12);
  padding: 22px 16px;
}

.admin-brand {
  border-bottom: 1px solid rgba(255, 250, 240, 0.16);
  padding-bottom: 16px;
}

.admin-brand span,
.admin-login-brand span {
  border-radius: 8px;
  background: #fffaf0;
  color: #111a17;
}

.admin-nav {
  gap: 7px;
}

.admin-nav a {
  position: relative;
  border-radius: 8px;
  color: rgba(255, 250, 240, 0.7);
  padding: 11px 12px 11px 14px;
}

.admin-nav a::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  border-color: rgba(255, 250, 240, 0.16);
  background: rgba(255, 250, 240, 0.1);
}

.admin-nav a.is-active::before {
  background: var(--admin-gold);
}

.admin-main {
  padding: 30px 34px 42px;
}

.admin-header {
  align-items: center;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(199, 155, 67, 0.12), transparent 38%),
    var(--admin-paper);
  box-shadow: 0 18px 44px rgba(18, 27, 24, 0.07);
  margin-bottom: 18px;
  padding: 18px 20px;
}

.detail-header {
  align-items: flex-start;
}

.admin-header p,
.admin-panel-head p,
.admin-login-brand p {
  color: #5f6a64;
}

.admin-header h1,
.admin-panel-head h2,
.admin-login-brand h1 {
  color: var(--admin-ink);
}

.admin-page button,
.admin-page .button,
.admin-page .admin-primary-link,
.admin-page .admin-row-action,
.admin-page a.admin-primary-link,
.admin-page a.admin-row-action,
.admin-primary-link,
.admin-row-action {
  border-color: #111a17;
  border-radius: 8px;
  background: #111a17;
  color: #fffaf0;
  box-shadow: none;
}

.admin-page button:hover,
.admin-page .button:hover,
.admin-page .admin-primary-link:hover,
.admin-page .admin-row-action:hover,
.admin-page a.admin-primary-link:hover,
.admin-page a.admin-row-action:hover,
.admin-primary-link:hover,
.admin-row-action:hover {
  border-color: var(--admin-green);
  background: var(--admin-green);
  color: #fffaf0;
}

.admin-page .button-secondary {
  border-color: #cfd8d2;
  background: #fffdf8;
  color: var(--admin-ink);
}

.admin-page .button-secondary:hover {
  border-color: var(--admin-green);
  background: var(--admin-green);
  color: #fffaf0;
}

.admin-panel,
.admin-table-panel,
.admin-login-card,
.detail-summary div {
  border-color: var(--admin-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent 150px),
    var(--admin-paper);
  box-shadow: 0 18px 46px rgba(18, 27, 24, 0.07);
}

.admin-panel {
  position: relative;
}

.admin-panel::before,
.admin-table-panel::before {
  content: "";
  height: 4px;
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--admin-green), var(--admin-gold), transparent 76%);
}

.admin-panel::before {
  margin: -18px -18px 14px;
}

.admin-table-panel::before {
  margin: 0;
}

.admin-stat {
  border-color: var(--admin-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), transparent 140px),
    var(--admin-paper);
  box-shadow: 0 16px 36px rgba(18, 27, 24, 0.07);
}

.admin-stat:hover,
.admin-work-item:hover,
.prompt-version-item:hover,
.prompt-preset-item:hover {
  border-color: rgba(36, 95, 88, 0.56);
}

.admin-stat-total {
  border-color: #111a17;
  background:
    linear-gradient(132deg, rgba(199, 155, 67, 0.22), transparent 46%),
    #111a17;
}

.admin-filter {
  border: 1px solid var(--admin-soft-line);
  border-radius: 8px;
  background: #f8f6ee;
  padding: 12px;
}

.admin-filter label,
.admin-form label {
  color: #2d3a35;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  border-color: #cfd8d2;
  border-radius: 6px;
  background: #fffefa;
}

.admin-page input:focus,
.admin-page select:focus,
.admin-page textarea:focus {
  border-color: var(--admin-green);
  outline: 3px solid rgba(36, 95, 88, 0.14);
}

.admin-table-caption,
.admin-table th {
  background: #f4f3ec;
}

.admin-table th {
  border-bottom-color: #d6ddd6;
  color: #65716b;
}

.admin-table td {
  border-bottom-color: var(--admin-soft-line);
}

.admin-table tr:hover td {
  background: #faf8f0;
}

.admin-user-cell strong,
.admin-source-cell span {
  color: var(--admin-ink);
}

.status-badge,
.progress-pills span {
  border-radius: 6px;
}

.progress-pills span {
  background: #fbfaf4;
  color: #53605a;
}

.status-badge {
  background: #f7f6ef;
}

.progress-pills span.is-done {
  border-color: var(--admin-green);
  background: #edf7f0;
  color: #245f3c;
}

.admin-document,
.admin-doc pre,
.editor-panel textarea,
.config-form textarea,
.prompt-form textarea[name="prompt_content"] {
  border-color: var(--admin-soft-line);
  background:
    linear-gradient(90deg, rgba(18, 27, 24, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    #fbfaf4;
  color: #26342f;
}

.admin-hint,
.admin-notice,
.generated-codes {
  border-color: var(--admin-line);
  background: #f7f6ef;
}

.admin-notice {
  border-left: 4px solid #56a36b;
  color: #245f3c;
}

.admin-notice-error {
  border-left-color: #b84a34;
  color: #963525;
}

.report-preview-panel {
  border-color: var(--admin-line);
  background: var(--admin-paper);
  box-shadow: 0 18px 44px rgba(18, 27, 24, 0.08);
}

.report-preview-toolbar {
  background:
    linear-gradient(90deg, rgba(36, 95, 88, 0.12), rgba(199, 155, 67, 0.14)),
    #f4f3ec;
}

.report-rendered {
  background:
    linear-gradient(90deg, rgba(199, 155, 67, 0.18) 0 5px, transparent 5px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), transparent 180px),
    #fffdf8;
}

.report-rendered-formal {
  background:
    linear-gradient(90deg, #111a17 0 5px, transparent 5px),
    linear-gradient(180deg, rgba(199, 155, 67, 0.12), transparent 170px),
    #fffdf8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.report-rendered h1 {
  border-bottom-color: #111a17;
  color: #111a17;
}

.report-rendered h2 {
  border-top-color: #dce3dd;
}

.report-rendered h3 {
  color: var(--admin-green);
}

.report-rendered blockquote {
  border-left-color: var(--admin-gold);
  background: #fbf4df;
}

.prompt-layout {
  gap: 20px;
}

.prompt-version-item,
.prompt-preset-item,
.admin-work-item,
.admin-doc {
  border-color: var(--admin-soft-line);
  background: #fffefa;
}

.prompt-version-item.is-active {
  border-color: rgba(36, 95, 88, 0.56);
  background: #f2f8f3;
}

.prompt-version-item.is-selected {
  box-shadow: inset 4px 0 0 var(--admin-gold);
}

.email-config-panel {
  max-width: 980px;
}

.tip-config-panel {
  margin-top: 20px;
}

.tip-enabled-control {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tip-enabled-control input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.tip-config-preview {
  display: grid;
  gap: 10px;
  justify-items: start;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 800;
}

.tip-config-preview img {
  width: 160px;
  height: 160px;
  border: 1px solid var(--admin-soft-line);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.email-test-strip,
.email-delivery-box {
  display: grid;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--admin-soft-line);
  border-radius: 8px;
  background: #f8f6ee;
  padding: 12px;
}

.email-test-strip {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.email-delivery-box {
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 0 12px;
}

.email-delivery-box strong,
.email-delivery-box span {
  display: block;
}

.email-delivery-box strong {
  color: var(--admin-ink);
  margin-bottom: 4px;
}

.email-delivery-box span {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.email-delivery-box form {
  margin: 0;
}

.admin-login-page {
  background:
    linear-gradient(124deg, #111a17 0 42%, #c79b43 42.1% 42.5%, #f3f1ea 42.6% 100%);
}

.admin-login-card {
  overflow: hidden;
  padding: 30px;
}

.admin-login-card::before {
  content: "";
  height: 5px;
  display: block;
  margin: -30px -30px 22px;
  background: linear-gradient(90deg, #245f58, #c79b43, #b84a34);
}

@media (max-width: 1080px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .intake-page {
    background:
      linear-gradient(180deg, var(--hero-bg) 0 104px, transparent 104px),
      linear-gradient(90deg, var(--page-grid) 1px, transparent 1px) 0 0 / 40px 40px,
      linear-gradient(0deg, var(--page-grid-soft) 1px, transparent 1px) 0 0 / 40px 40px,
      var(--cream);
  }

  .form-first-grid {
    grid-template-columns: 1fr;
  }

  .start-copy {
    order: 2;
  }
}

@media (max-width: 720px) {
  .invite-shell,
  .success-shell {
    width: min(100% - 28px, 560px);
    min-height: 100svh;
    padding: 24px 0;
  }

  .invite-card,
  .success-card {
    padding: 26px 20px;
  }

  .invite-card h1,
  .success-card h1,
  .form-heading-compact h1 {
    font-size: 30px;
  }

  .intake-start {
    padding: 18px 14px 34px;
  }

  .form-first-grid .intake-workbench {
    padding: 22px 16px;
  }

  .form-first-grid .field {
    padding: 10px;
  }

  .submit-row,
  .success-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .success-actions .button,
  .success-secondary-link {
    width: 100%;
  }

  .admin-main {
    padding: 16px;
  }

  .admin-header {
    align-items: stretch;
    padding: 16px;
  }

  .email-test-strip,
  .email-delivery-box {
    grid-template-columns: 1fr;
  }
}

/* Focused UI fixes: mobile operations should read clearly and never force horizontal page scroll. */
.admin-detail-layout,
.admin-detail-layout > *,
.admin-workflow,
.admin-workflow > *,
.editor-panel,
.document-panel,
.report-preview-panel,
.report-rendered,
.admin-form,
.admin-form label {
  max-width: 100%;
  min-width: 0;
}

.admin-workflow {
  grid-template-columns: minmax(0, 1fr);
}

.admin-form textarea,
.editor-panel textarea,
.config-form textarea,
.prompt-form textarea[name="prompt_content"] {
  max-width: 100%;
  min-width: 0;
}

.report-preview-panel {
  overflow: hidden;
}

.report-rendered {
  overflow-x: auto;
}

.report-table-wrap {
  max-width: 100%;
}

@media (max-width: 720px) {
  .admin-sidebar {
    gap: 10px;
    padding: 12px;
  }

  .admin-brand {
    width: 100%;
    padding-bottom: 8px;
  }

  .admin-brand span {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .admin-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-nav a {
    min-height: 34px;
    justify-content: center;
    padding: 8px 6px;
    text-align: center;
    font-size: 13px;
  }

  .admin-logout {
    width: 100%;
  }

  .admin-logout button {
    min-height: 34px;
  }

  .admin-detail-layout,
  .admin-workflow {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-panel-head form,
  .admin-panel-head button {
    width: 100%;
  }

  .admin-table td[data-label] {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .admin-table td[data-label]::before {
    content: attr(data-label) !important;
    color: #66736d;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
  }

  .admin-table td[colspan] {
    display: block;
  }

  .admin-table td[colspan]::before {
    content: none !important;
  }

  .submit-row {
    gap: 10px;
  }

}

/* C3 public entry and privacy pages. */
.invite-page,
.c3-public-page {
  min-height: 100vh;
  color: var(--c3-ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(223, 104, 78, 0.18), transparent 30%),
    var(--c3-bg);
}

.invite-page::before,
.invite-page::after,
.c3-public-page::before,
.c3-public-page::after {
  content: none;
}

.invite-shell {
  width: min(720px, calc(100% - 32px));
  padding: 48px 0;
}

.invite-card {
  border-radius: var(--c3-radius-panel);
  background: var(--c3-panel);
  box-shadow: var(--c3-shadow);
  padding: clamp(28px, 6vw, 56px);
}

.invite-card::before,
.invite-card::after {
  content: none;
}

.invite-card .c3-wordmark {
  margin-bottom: 44px;
}

.invite-card .invite-kicker,
.c3-public-panel .invite-kicker {
  margin: 0 0 12px;
  color: var(--c3-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.invite-card .invite-error {
  max-width: none;
  margin: 0 0 18px;
  border: 1px solid rgba(223, 104, 78, 0.36);
  border-radius: var(--c3-radius-control);
  background: rgba(223, 104, 78, 0.1);
  color: #913d2d;
  padding: 12px 14px;
  font-weight: 800;
  line-height: 1.6;
}

.invite-card h1 {
  margin: 0 0 18px;
  color: var(--c3-ink);
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1.12;
}

.invite-card .invite-lead {
  max-width: 590px;
  margin: 0 0 22px;
  color: var(--c3-muted);
  font-size: 17px;
  line-height: 1.8;
}

.invite-trust {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.invite-trust .c3-chip {
  text-decoration: none;
}

.invite-trust a.c3-chip {
  min-height: 44px;
}

.c3-public-back {
  color: var(--c3-sidebar);
  font-weight: 800;
  text-underline-offset: 4px;
}

.invite-card .invite-delivery-note {
  margin: 16px 0 0;
  color: var(--c3-muted);
  font-size: 14px;
  line-height: 1.7;
}

.invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 36px;
}

.invite-form label {
  grid-column: 1 / -1;
  color: var(--c3-ink);
  font-weight: 800;
}

.invite-form input {
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--c3-border);
  border-radius: var(--c3-radius-control);
  background: #fff;
  color: var(--c3-ink);
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.invite-form .c3-primary-action {
  min-height: 52px;
  border-radius: 999px;
  padding: 0 24px;
  box-shadow: none;
}

.c3-public-header,
.c3-public-shell {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.c3-public-header {
  padding: 32px 0 20px;
  color: var(--c3-panel);
}

.c3-public-header .c3-wordmark {
  color: inherit;
  text-decoration: none;
}

.c3-public-shell {
  padding-bottom: 48px;
}

.c3-public-panel {
  margin-bottom: 20px;
  padding: clamp(28px, 6vw, 52px);
}

.c3-public-panel h1 {
  color: var(--c3-ink);
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.2;
}

.c3-public-panel h2 {
  margin-top: 34px;
  color: var(--c3-ink);
  font-size: 21px;
}

.c3-public-panel p {
  color: var(--c3-muted);
  font-size: 16px;
  line-height: 1.85;
}

.c3-public-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--c3-panel);
}

@media (max-width: 560px) {
  .invite-shell {
    align-items: start;
    padding: 16px 0;
  }

  .invite-card .c3-wordmark {
    margin-bottom: 30px;
  }

  .invite-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .invite-form .c3-primary-action {
    width: 100%;
  }
}

/* C3 intake and submission receipt. */
.c3-intake-page,
.c3-success-page {
  min-height: 100vh;
  color: var(--c3-ink);
  background: var(--c3-bg);
}

.c3-intake-page::before,
.c3-intake-page::after,
.c3-success-page::before,
.c3-success-page::after {
  content: none;
}

.c3-intake-page .intake-start {
  padding: 32px 24px 56px;
}

.c3-intake-page .intake-legal {
  width: min(1180px, calc(100% - 48px));
  margin: -24px auto 40px;
  border-top: 1px solid rgba(248, 244, 235, 0.18);
  color: rgba(248, 244, 235, 0.76);
  padding-top: 18px;
  font-size: 13px;
  line-height: 1.75;
}

.c3-intake-page .intake-legal p {
  margin: 0 0 6px;
}

.c3-intake-page .intake-legal strong {
  margin-right: 0.75em;
  color: var(--c3-panel);
}

.c3-intake-page .form-first-grid {
  width: min(1180px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 24px;
}

.c3-intake-page .intake-workbench {
  border: 0;
  border-radius: var(--c3-radius-panel);
  background: var(--c3-panel);
  box-shadow: var(--c3-shadow);
  padding: clamp(20px, 4vw, 40px);
}

.c3-intake-page .intake-workbench::before {
  content: none;
}

.intake-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  counter-reset: intake-step;
  list-style: none;
}

.intake-progress li {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--c3-border);
  border-radius: var(--c3-radius-control);
  color: var(--c3-muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
  counter-increment: intake-step;
}

.intake-progress li::before {
  content: counter(intake-step);
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--c3-soft-accent);
  color: var(--c3-accent);
  font-size: 12px;
}

.draft-restore-notice {
  margin: 14px 0 0;
  border-left: 3px solid var(--c3-accent);
  color: var(--c3-muted);
  padding: 8px 12px;
}

.c3-intake-page .intake-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border-color: var(--c3-border);
  background: #fffdf8;
  box-shadow: none;
  padding: clamp(18px, 3vw, 28px);
}

.c3-intake-page .intake-section .section-heading {
  margin-bottom: 2px;
}

.c3-intake-page .intake-section .section-heading::before {
  background: var(--c3-accent);
}

.c3-intake-page .intake-section .section-heading h2 {
  color: var(--c3-ink);
  font-size: 20px;
}

.c3-intake-page .intake-section .field-grid {
  gap: 14px;
}

.c3-intake-page .intake-form input,
.c3-intake-page .intake-form select,
.c3-intake-page .intake-form textarea {
  min-height: 44px;
  border-radius: var(--c3-radius-control);
}

.c3-intake-page .intake-form textarea {
  min-height: 120px;
}

.optional-background {
  border-top: 1px solid var(--c3-border);
  padding-top: 10px;
}

.optional-background summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--c3-border);
  border-radius: var(--c3-radius-control);
  background: #fffefa;
  color: var(--c3-ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  padding: 8px 10px 8px 14px;
}

.optional-background summary::-webkit-details-marker {
  display: none;
}

.optional-background summary::after {
  content: "＋";
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  margin-left: auto;
  border: 1px solid rgba(223, 104, 78, 0.34);
  border-radius: 50%;
  background: rgba(223, 104, 78, 0.1);
  color: var(--c3-accent);
  font-size: 18px;
  line-height: 1;
}

.optional-background[open] > summary {
  margin-bottom: 14px;
}

.optional-background[open] > summary::after {
  content: "－";
}

.optional-background-help {
  margin: 0 0 16px;
  color: var(--c3-muted);
  line-height: 1.7;
}

.optional-background .field-grid {
  margin-top: 4px;
}

.c3-intake-page .submit-row button,
.c3-success-page .c3-primary-action {
  min-height: 48px;
  border-radius: 999px;
  background: var(--c3-sidebar);
  color: var(--c3-panel);
}

.c3-success-page .success-shell {
  width: min(620px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
}

.c3-success-page .success-card {
  width: 100%;
  overflow: visible;
  border-color: var(--c3-border);
  border-radius: var(--c3-radius-panel);
  background: var(--c3-panel);
  box-shadow: var(--c3-shadow);
  padding: clamp(28px, 7vw, 52px);
}

.c3-success-page .success-card::before,
.c3-success-page .success-card::after {
  content: none;
}

.c3-success-page .c3-wordmark {
  margin: 0 0 42px;
  color: var(--c3-sidebar);
}

.c3-success-page .success-kicker {
  margin: 0 0 10px;
  color: var(--c3-accent);
  font-size: 13px;
  font-weight: 800;
}

.c3-success-page .success-card h1 {
  margin: 0 0 14px;
  color: var(--c3-ink);
  font-size: clamp(36px, 8vw, 52px);
}

.c3-success-page .success-lead {
  margin: 0 0 28px;
  color: var(--c3-muted);
  line-height: 1.8;
}

.submission-receipt {
  display: grid;
  gap: 0;
  margin: 0 0 28px;
  border-top: 1px solid var(--c3-border);
}

.submission-receipt div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--c3-border);
  padding: 16px 0;
}

.submission-receipt dt {
  color: var(--c3-muted);
}

.submission-receipt dd {
  min-width: 0;
  margin: 0;
  color: var(--c3-ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.c3-success-page .c3-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-decoration: none;
}

@media (max-width: 980px) {
  .c3-intake-page .form-first-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .c3-intake-page .intake-start {
    padding: 14px 12px 28px;
  }

  .c3-intake-page .intake-workbench {
    padding: 20px 14px;
  }

  .intake-progress {
    grid-template-columns: minmax(0, 1fr);
  }

  .c3-intake-page .intake-section .field-grid,
  .submission-receipt div {
    grid-template-columns: minmax(0, 1fr);
  }

  .submission-receipt div {
    gap: 5px;
  }

  .c3-success-page .success-shell {
    width: min(100% - 24px, 620px);
    min-height: 100svh;
    padding: 12px 0;
  }

  .c3-success-page .c3-primary-action {
    width: 100%;
  }
}

/* C3 report reader: keep the report primary and the original intake available on demand. */
.readonly-page .readonly-shell {
  width: min(100% - 32px, 1040px);
  padding: 32px 0 56px;
}

.readonly-page .report-summary,
.readonly-page .readonly-report,
.readonly-page .report-original-input {
  width: min(100%, 880px);
  margin-right: auto;
  margin-left: auto;
}

.readonly-page .report-summary {
  border: 1px solid var(--c3-border, #d7ded9);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 12px 34px rgba(17, 26, 23, 0.06);
}

.readonly-page .readonly-report {
  margin-top: 22px;
  padding: 0;
  overflow: hidden;
}

.readonly-page .report-reading-toolbar {
  position: static;
  padding: 13px 20px;
}

.readonly-page .report-first-screen {
  display: grid;
  gap: 18px;
  border-bottom: 1px solid var(--c3-border, #d7ded9);
  background: var(--c3-paper, #fffdf8);
  padding: 34px 48px 38px;
}

.readonly-page .report-first-screen-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
}

.readonly-page .report-first-screen-head p,
.readonly-page .report-key-line span,
.readonly-page .report-light-action span {
  margin: 0 0 8px;
  color: var(--c3-accent, #df684e);
  font-size: 13px;
  font-weight: 850;
}

.readonly-page .report-first-screen h2 {
  margin: 0;
  color: var(--c3-ink, #17221e);
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.35;
}

.readonly-page .report-first-screen-meta {
  display: grid;
  gap: 8px;
  color: var(--c3-muted, #64726c);
  font-size: 13px;
  white-space: nowrap;
}

.readonly-page .report-key-line,
.readonly-page .report-light-action {
  border-radius: 12px;
  padding: 18px 20px;
}

.readonly-page .report-key-line {
  border: 1px solid var(--c3-border, #d7ded9);
  background: #f7f6ef;
}

.readonly-page .report-light-action {
  border-left: 4px solid var(--c3-accent, #df684e);
  background: var(--c3-soft-accent, #fff0eb);
}

.readonly-page .report-key-line strong,
.readonly-page .report-light-action strong {
  display: block;
  color: var(--c3-ink, #17221e);
  line-height: 1.7;
}

.readonly-page .readonly-report-preview .report-rendered {
  width: min(100%, 760px);
  margin: 0 auto;
  overflow-x: visible;
  padding: 42px 48px 50px;
}

.readonly-page .report-rendered h1 {
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.readonly-page .report-rendered h2 {
  margin-top: 40px;
  padding-top: 24px;
}

.readonly-page .report-rendered h3 {
  margin-top: 28px;
}

.readonly-page .report-rendered p,
.readonly-page .report-rendered ul,
.readonly-page .report-rendered ol {
  margin-top: 16px;
}

.readonly-page .report-original-input {
  margin-top: 24px;
  border: 1px solid var(--c3-border, #d7ded9);
  border-radius: 12px;
  background: var(--c3-paper, #fffdf8);
  overflow: hidden;
}

.readonly-page .report-tip-card {
  width: min(100%, 880px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin: 24px auto 0;
  border: 1px solid var(--c3-border, #d7ded9);
  border-radius: 12px;
  background: var(--c3-paper, #fffdf8);
  box-shadow: 0 12px 34px rgba(17, 26, 23, 0.06);
  padding: 26px 30px;
}

.readonly-page .report-tip-card h2 {
  margin: 0 0 10px;
  color: var(--c3-ink, #17221e);
  font-size: clamp(20px, 2.6vw, 28px);
}

.readonly-page .report-tip-card p {
  margin: 0;
  color: var(--c3-muted, #64726c);
  line-height: 1.75;
}

.readonly-page .report-tip-card img {
  width: 168px;
  height: 168px;
  border: 1px solid var(--c3-border, #d7ded9);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.readonly-page .report-original-input summary {
  cursor: pointer;
  list-style-position: inside;
  padding: 17px 20px;
  color: var(--c3-ink, #17221e);
  font-weight: 850;
}

.readonly-page .report-original-input[open] summary {
  border-bottom: 1px solid var(--c3-border, #d7ded9);
}

.readonly-page .report-rendered-intake {
  background: #f7f6ef;
  padding: 26px 30px 32px;
}

@media (max-width: 720px) {
  .readonly-page .readonly-shell {
    width: min(100% - 24px, 1040px);
    padding: 16px 0 36px;
  }

  .readonly-page .readonly-report-preview .report-rendered,
  .readonly-page .report-rendered-intake {
    width: 100%;
    padding: 28px 18px 34px;
  }

  .readonly-page .report-first-screen {
    padding: 26px 18px 30px;
  }

  .readonly-page .report-first-screen-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .readonly-page .report-first-screen-meta {
    grid-template-columns: repeat(2, minmax(0, max-content));
    white-space: normal;
  }

  .readonly-page .report-rendered h2 {
    margin-top: 32px;
  }

  .readonly-page .report-tip-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    padding: 24px 20px;
  }

  .readonly-page .report-table-wrap {
    border: 0;
    overflow: visible;
  }

  .readonly-page .report-rendered table,
  .readonly-page .report-rendered tbody,
  .readonly-page .report-rendered tr,
  .readonly-page .report-rendered td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .readonly-page .report-rendered table {
    background: transparent;
  }

  .readonly-page .report-rendered thead {
    display: none;
  }

  .readonly-page .report-rendered tbody {
    display: grid;
    gap: 12px;
  }

  .readonly-page .report-rendered tr {
    border: 1px solid var(--c3-border, #d7ded9);
    border-radius: 10px;
    background: #fffdf8;
    overflow: hidden;
  }

  .readonly-page .report-rendered td {
    display: grid;
    grid-template-columns: minmax(88px, 0.38fr) minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid #e4e9e5;
    padding: 11px 13px;
  }

  .readonly-page .report-rendered td:last-child {
    border-bottom: 0;
  }

  .readonly-page .report-rendered td::before {
    content: attr(data-label) !important;
    color: var(--c3-muted, #64726c);
    font-size: 12px;
    font-weight: 800;
  }
}

/* Task 7: shared C3 admin operations workspace. */
.admin-page {
  --admin-ink: var(--c3-ink);
  --admin-muted: var(--c3-muted);
  --admin-line: var(--c3-border);
  --admin-soft-line: color-mix(in srgb, var(--c3-border) 72%, white);
  --admin-paper: var(--c3-panel);
  --admin-wash: #f0ece3;
  --admin-green: var(--c3-sidebar);
  --admin-gold: var(--c3-accent);
  color: var(--c3-ink);
  background: #f0ece3;
}

.admin-shell {
  grid-template-columns: 238px minmax(0, 1fr);
}

.admin-sidebar {
  gap: 20px;
  border-right: 0;
  background: var(--c3-sidebar);
  color: var(--c3-panel);
  box-shadow: none;
  padding: 24px 18px;
}

.admin-wordmark {
  min-height: 46px;
  border-bottom: 1px solid rgba(248, 244, 235, 0.18);
  color: var(--c3-panel);
  font-size: 17px;
  padding: 0 10px 16px;
}

.admin-nav {
  gap: 8px;
}

.admin-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: var(--c3-radius-control);
  color: rgba(248, 244, 235, 0.76);
  padding: 10px 14px;
}

.admin-nav a::before {
  top: 11px;
  bottom: 11px;
  left: 5px;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  border-color: rgba(248, 244, 235, 0.16);
  background: rgba(248, 244, 235, 0.1);
  color: var(--c3-panel);
}

.admin-nav a.is-active::before {
  background: var(--c3-accent);
}

.admin-logout button {
  min-height: 44px;
  border-color: rgba(248, 244, 235, 0.3);
  background: transparent;
  color: var(--c3-panel);
}

.admin-logout button:hover {
  border-color: var(--c3-accent);
  background: var(--c3-accent);
  color: var(--c3-bg);
}

.admin-main {
  padding: 32px;
}

.admin-header,
.admin-panel,
.admin-table-panel,
.admin-login-card,
.detail-summary div,
.admin-stat {
  border-color: var(--c3-border);
  border-radius: var(--c3-radius-panel);
  background: var(--c3-panel);
  box-shadow: none;
}

.admin-header {
  background: var(--c3-panel);
  padding: 22px 24px;
}

.admin-panel::before,
.admin-table-panel::before {
  display: none;
}

.admin-panel {
  overflow: hidden;
}

.admin-page button,
.admin-page .button,
.admin-primary-link,
.admin-row-action {
  min-height: 44px;
  border-radius: var(--c3-radius-control);
  background: var(--c3-sidebar);
  color: var(--c3-panel);
}

.invite-generate-form input,
.invite-filter-panel input,
.invite-filter-panel select {
  min-height: 44px;
}

.admin-page button:hover,
.admin-page .button:hover,
.admin-primary-link:hover,
.admin-row-action:hover {
  border-color: var(--c3-accent);
  background: var(--c3-accent);
  color: var(--c3-bg);
}

.admin-page .button-secondary {
  border-color: var(--c3-border);
  background: transparent;
  color: var(--c3-ink);
}

.admin-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stat {
  min-height: 124px;
  justify-content: space-between;
}

.admin-stat:hover {
  border-color: var(--c3-accent);
  background: var(--c3-soft-accent);
}

.admin-stat strong {
  color: var(--c3-ink);
}

.admin-table-panel {
  overflow: hidden;
}

.admin-table-caption,
.admin-table th {
  background: color-mix(in srgb, var(--c3-panel) 72%, var(--c3-border));
}

.admin-table td,
.admin-user-cell,
.admin-user-cell span,
.admin-user-cell small,
.admin-source-cell,
.admin-next-action,
.invite-table-code {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-attention {
  color: var(--c3-ink);
  font-size: 14px;
}

.admin-queue-action {
  min-width: 180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-login-page {
  background: linear-gradient(124deg, var(--c3-bg) 0 44%, var(--c3-accent) 44.05% 44.45%, #f0ece3 44.55% 100%);
}

.admin-login-card::before {
  background: var(--c3-accent);
}

@media (max-width: 1080px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-wordmark {
    min-height: 44px;
    border: 0;
    padding: 0 10px;
  }
}

@media (max-width: 720px) {
  .admin-main {
    padding: 14px;
  }

  .admin-sidebar {
    padding: 12px;
  }

  .admin-wordmark {
    width: 100%;
    border-bottom: 1px solid rgba(248, 244, 235, 0.18);
    padding-bottom: 10px;
  }

  .admin-nav a,
  .admin-logout button,
  .admin-page button,
  .admin-page .button,
  .admin-primary-link,
  .admin-row-action {
    min-height: 44px;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stat {
    min-height: 108px;
  }

  .admin-table tr {
    border: 1px solid var(--c3-border);
    border-radius: var(--c3-radius-control);
    background: var(--c3-panel);
    margin: 12px;
    overflow: hidden;
  }

  .admin-table td[data-label] {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .admin-table td[data-label]::before {
    content: attr(data-label);
    color: var(--c3-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
  }

  .admin-table td[colspan] {
    display: block;
  }

  .admin-table td[colspan]::before {
    content: none;
  }

  .admin-queue-action {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }
}
