:root {
  --ink: #17211b;
  --muted: #647067;
  --subtle: #8b958d;
  --paper: #f5f3ed;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --line: #dcded7;
  --line-strong: #c5c9c0;
  --green: #176b45;
  --green-dark: #105136;
  --green-soft: #e6f1ea;
  --amber: #a75d08;
  --amber-soft: #fff2da;
  --red: #ac3126;
  --red-soft: #fbe9e6;
  --blue: #245e9b;
  --blue-soft: #e9f1fb;
  --shadow-sm: 0 1px 2px rgba(23, 33, 27, 0.06);
  --shadow-lg: 0 18px 50px rgba(23, 33, 27, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(23, 107, 69, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 107, 69, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--green);
}

code,
pre,
.stage-kicker,
.eyebrow,
.method-badge,
.result-label {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(197, 201, 192, 0.75);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

main {
  padding: 58px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 48px;
  align-items: end;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero h1 {
  max-width: 740px;
  margin: 0;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: clamp(38px, 5.4vw, 68px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-badges {
  display: grid;
  gap: 9px;
  justify-items: stretch;
}

.hero-badges span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.hero-badges span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.connection-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  gap: 24px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.connection-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-copy strong,
.connection-copy span {
  display: block;
}

.connection-copy strong {
  font-size: 14px;
}

.connection-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--subtle);
  box-shadow: 0 0 0 5px rgba(139, 149, 141, 0.12);
}

.connection-card.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(23, 107, 69, 0.12);
}

.connection-card.failed .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(172, 49, 38, 0.12);
}

.connection-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-strong);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #a0a79f;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 107, 69, 0.12);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
.file-remove:focus-visible {
  outline: 3px solid rgba(23, 107, 69, 0.2);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 5px 16px rgba(23, 107, 69, 0.16);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.button-secondary:hover:not(:disabled) {
  border-color: #9da59c;
  background: #fafbf8;
}

.button-ghost {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 14px 17px;
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #6f4a1e;
  background: var(--amber-soft);
}

.callout p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

.callout-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 800;
}

.callout code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.65);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 34px 0 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
  list-style: none;
}

.stepper li {
  background: rgba(255, 253, 248, 0.85);
}

.stepper a {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  color: var(--muted);
  text-decoration: none;
}

.stepper li.active,
.stepper li:hover {
  background: var(--surface-strong);
}

.stepper li.active a,
.stepper li:hover a {
  color: var(--ink);
}

.step-number {
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 26px;
  font-style: italic;
}

.stepper strong,
.stepper small {
  display: block;
}

.stepper strong {
  font-size: 14px;
}

.stepper small {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 12px;
}

.stage-card {
  scroll-margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.stage-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 30px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.stage-index {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
}

.stage-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.stage-header h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 29px;
  font-weight: 600;
}

.stage-header p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.method-badge {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
}

form {
  padding: 30px 32px 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.form-grid-single {
  grid-template-columns: minmax(260px, 480px);
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 750;
}

.field em,
.requirement-source em {
  color: var(--red);
  font-size: 11px;
  font-style: normal;
}

.optional-mark {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 750;
  vertical-align: middle;
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f0f1ec;
}

.segmented label {
  margin: 0;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented input:checked + span {
  color: var(--green-dark);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + span {
  outline: 3px solid rgba(23, 107, 69, 0.2);
}

.upload-section,
.callback-panel,
.requirement-source {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h3,
.section-heading h4,
.requirement-source h3 {
  margin: 0;
  font-size: 15px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-heading > span,
.size-counter,
.editor-meta {
  color: var(--subtle);
  font-size: 11px;
}

.dropzone {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 24px;
  border: 1.5px dashed #aeb5ac;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone strong {
  color: var(--ink);
  font-size: 14px;
}

.dropzone small {
  font-size: 11px;
}

.upload-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 20px;
  line-height: 1;
}

.file-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.file-list:empty {
  display: none;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.file-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.file-type {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-name,
.file-size {
  display: block;
}

.file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}

.file-remove {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.file-remove:hover {
  color: var(--red);
  border-color: #f2c7c1;
  background: var(--red-soft);
}

.callback-panel {
  padding: 20px;
  border: 1px solid #d4c19b;
  border-radius: var(--radius-md);
  background: #fffaf0;
}

.callback-panel[hidden] {
  display: none;
}

.callback-panel .section-heading {
  margin-bottom: 16px;
}

.callback-panel textarea {
  min-height: 42px;
}

.request-status {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: #f8f9f5;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
}

.request-status[hidden] {
  display: none;
}

.request-status.loading {
  border-color: #b9cee4;
  color: #214e7c;
  background: var(--blue-soft);
}

.request-status.success {
  border-color: #afd0bd;
  color: var(--green-dark);
  background: var(--green-soft);
}

.request-status.error {
  border-color: #efb8b2;
  color: #84271f;
  background: var(--red-soft);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.form-actions .button-primary {
  min-width: 154px;
}

.file-button {
  position: relative;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.baseline-file-card {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.baseline-file-card.is-empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

.baseline-file-card strong,
.baseline-file-card span {
  display: block;
}

.baseline-file-card strong {
  color: var(--ink);
  font-size: 12px;
}

.baseline-file-card span {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 10px;
}

.compact-editor {
  min-height: 190px;
}

.editor-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 7px;
}

.result-section {
  padding: 30px 32px 34px;
  border-top: 1px solid var(--line);
  background: #eff2ec;
}

.result-section[hidden] {
  display: none;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.result-label {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.result-heading h3 {
  margin: 0;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 24px;
  font-weight: 600;
}

.task-reference {
  margin: 7px 0 0;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary-grid:empty {
  display: none;
}

.revision-summary {
  margin-bottom: 16px;
  padding: 17px;
  border: 1px solid #c6d6c9;
  border-radius: var(--radius-md);
  background: var(--green-soft);
}

.revision-summary[hidden] {
  display: none;
}

.revision-summary .section-heading {
  margin-bottom: 12px;
}

.revision-summary .summary-grid {
  margin-bottom: 0;
}

.revision-summary .metric-card small {
  overflow-wrap: anywhere;
}

.metric-card {
  min-height: 94px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  margin-top: 7px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 600;
}

.metric-card small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}

.accepted-card {
  padding: 22px;
  border: 1px solid #b8cde3;
  border-radius: var(--radius-md);
  color: #234b73;
  background: var(--blue-soft);
}

.accepted-card[hidden] {
  display: none;
}

.accepted-card h4 {
  margin: 0 0 8px;
  color: #173e66;
}

.accepted-card p {
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.65;
}

.accepted-card code {
  overflow-wrap: anywhere;
}

.accepted-card .button {
  margin-top: 10px;
}

.editor-card,
.structured-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.editor-card .section-heading,
.structured-card .section-heading {
  margin-bottom: 11px;
}

.result-editor {
  min-height: 310px;
  border-color: var(--line);
  background: #fbfcf9;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.75;
  tab-size: 2;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(125px, 0.8fr);
  gap: 8px;
}

.filter-row input,
.filter-row select {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 11px;
}

.result-list {
  display: grid;
  gap: 9px;
}

.result-empty {
  padding: 34px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--subtle);
  text-align: center;
  font-size: 12px;
}

.result-item {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 10px;
  background: #fcfdfb;
}

.result-item.risk-veto,
.result-item.status-non_compliant {
  border-left-color: var(--red);
}

.result-item.risk-mandatory,
.result-item.status-missing_response {
  border-left-color: var(--amber);
}

.result-item.risk-scoring,
.result-item.status-compliant {
  border-left-color: var(--green);
}

.result-item.needs-review {
  background: #fffaf3;
}

.item-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.item-id {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.item-title {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eceee9;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.tag.danger {
  color: #8a281f;
  background: var(--red-soft);
}

.tag.warning {
  color: #7a4a10;
  background: var(--amber-soft);
}

.tag.success {
  color: var(--green-dark);
  background: var(--green-soft);
}

.item-copy {
  margin: 10px 0 0;
  color: #3e4941;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.item-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #e8eae5;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.item-meta span {
  overflow-wrap: anywhere;
}

.evidence-list {
  display: grid;
  gap: 7px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  padding: 9px 10px;
  border-radius: 7px;
  color: #4e5a51;
  background: #f0f3ed;
  font-size: 10px;
  line-height: 1.55;
}

.raw-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.raw-details summary {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.raw-details pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: #344039;
  background: #f7f8f5;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-connector {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.flow-connector span {
  height: 1px;
  background: var(--line-strong);
}

footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 36px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 14px 38px rgba(23, 33, 27, 0.18);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-badges {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .connection-card {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    min-height: 68px;
  }

  .topbar-nav a {
    padding: 7px 9px;
    font-size: 11px;
  }

  .topbar-nav a.active {
    display: none;
  }

  main {
    padding-top: 36px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .hero-badges {
    grid-template-columns: 1fr;
  }

  .connection-controls {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: 1fr;
  }

  .stage-header {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 23px 19px;
  }

  .method-badge {
    display: none;
  }

  .stage-header h2 {
    font-size: 24px;
  }

  form,
  .result-section {
    padding: 23px 19px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-topline {
    flex-direction: column;
  }

  .tag-row {
    justify-content: flex-start;
  }

  .item-meta {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
