:root {
  color-scheme: light;
  --ink: #181517;
  --text: #4f494d;
  --muted: #777075;
  --plum: #7b102e;
  --plum-dark: #5e0b23;
  --plum-soft: #f8eef1;
  --coral: #cf776d;
  --canvas: #fcfaf9;
  --surface: #ffffff;
  --surface-soft: #faf7f6;
  --line: #e7deda;
  --line-strong: #d9cac4;
  --danger: #b42318;
  --danger-soft: #fff2f0;
  --success: #24704a;
  --success-soft: #eef8f2;
  --shadow-sm: 0 6px 18px rgba(61, 31, 40, 0.06);
  --shadow-lg: 0 18px 56px rgba(61, 31, 40, 0.09);
  --font: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, transparent 0 98%, rgba(123, 16, 46, 0.025) 98% 100%) 0 0 / 48px 48px,
    var(--canvas);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, a, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: relative;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 54px;
  display: inline-grid;
  place-items: center;
  color: var(--plum);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.14em;
}

.brand-mark::after {
  content: "";
  width: 38px;
  height: 1px;
  margin-top: -4px;
  background: var(--coral);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 23px;
}

.help-button,
.logout-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 610;
}

.help-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
}

.help-button svg,
.admin-identity svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 23px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 610;
}

.admin-identity svg { color: var(--plum); }

.logout-button {
  min-height: 38px;
  padding: 0 4px;
}

.help-button:hover,
.logout-button:hover { color: var(--plum); }
.logout-button:disabled { cursor: wait; opacity: 0.5; }

.app-shell {
  position: relative;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 55px 0 40px;
}

.app-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -75px;
  right: -90px;
  width: 330px;
  height: 210px;
  border: 1px solid rgba(123, 16, 46, 0.08);
  border-radius: 55% 12% 60% 18%;
  transform: rotate(-12deg);
  background: rgba(207, 119, 109, 0.035);
}

.view { animation: view-in 360ms cubic-bezier(.2,.7,.3,1) both; }
.intro { text-align: center; }

.intro h1,
.result-canvas h1,
.login-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.intro p,
.result-subtitle {
  max-width: 720px;
  margin: 17px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.steps {
  width: min(750px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 35px auto 31px;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink);
}

.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -25px;
  width: 50px;
  border-top: 1px dashed rgba(123, 16, 46, 0.52);
}

.steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: calc(50% - 4px);
  right: -27px;
  border-width: 4px 0 4px 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--plum);
}

.steps span {
  width: 48px;
  height: 48px;
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--plum);
  box-shadow: 0 8px 18px rgba(123, 16, 46, 0.17);
}

.steps svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.steps strong { font-size: 15px; font-weight: 670; }

.master-card {
  width: min(1120px, 100%);
  min-height: 104px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin: 0 auto 22px;
  padding: 17px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-sm);
}

.master-card.has-master { border-color: rgba(123,16,46,.28); }

.master-card-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--plum);
  background: var(--plum-soft);
}

.master-card-icon svg {
  width: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.master-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.master-eyebrow {
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
}

.master-card-copy strong {
  overflow: hidden;
  color: var(--plum-dark);
  font-size: 18px;
  font-weight: 710;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-card-copy > span:not(.master-eyebrow):not(.master-feedback) {
  color: var(--muted);
  font-size: 13px;
}

.master-feedback {
  min-height: 18px;
  color: var(--plum);
  font-size: 13px;
}

.master-feedback:empty { display: none; }
.master-feedback.is-error { color: var(--danger); }

.drop-zone {
  width: min(1120px, 100%);
  min-height: 315px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 36px 24px;
  border: 1.5px dashed rgba(123, 16, 46, 0.68);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--plum);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.drop-zone[aria-busy="true"] { cursor: wait; opacity: .62; }

.upload-symbol {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  color: var(--plum);
}

.upload-symbol svg {
  width: 58px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone h2 {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 710;
  letter-spacing: -0.03em;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 24px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button {
  border: 1px solid var(--plum);
  color: #fff;
  background: var(--plum);
  box-shadow: 0 8px 18px rgba(123,16,46,.16);
}

.primary-button:hover {
  border-color: var(--plum-dark);
  background: var(--plum-dark);
  box-shadow: 0 10px 22px rgba(123,16,46,.22);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--plum);
  color: var(--plum);
  background: #fff;
}

.secondary-button:hover { background: var(--plum-soft); transform: translateY(-1px); }
.primary-button:disabled,
.secondary-button:disabled { cursor: wait; opacity: .48; transform: none; }
.primary-button.is-disabled {
  border-color: #c8bfbb;
  color: #837b7f;
  background: #e9e5e3;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: auto;
  transform: none;
}

.primary-button svg,
.secondary-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.master-button { min-width: 112px; white-space: nowrap; }
.master-card.is-busy .master-card-icon { animation: pulse 1.2s ease-in-out infinite; }

.file-name {
  max-width: min(680px, 100%);
  margin: 13px 0 0;
  overflow: hidden;
  color: var(--plum-dark);
  font-size: 13px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name:empty { display: none; }

.upload-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.processing,
.error-message {
  width: min(760px, 100%);
  margin: 20px auto 0;
  border-radius: 12px;
}

.processing {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  padding: 17px 19px 21px;
  border: 1px solid rgba(123,16,46,.22);
  background: var(--plum-soft);
}

.processing[hidden], .error-message[hidden] { display: none; }

.spinner {
  width: 25px;
  height: 25px;
  border: 2px solid rgba(123,16,46,.16);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.processing strong { display: block; color: var(--ink); font-size: 14px; }
.processing span:not(.spinner) { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.progress-track {
  position: absolute;
  right: 19px;
  bottom: 10px;
  left: 57px;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(123,16,46,.11);
}

.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--plum); transition: width 180ms linear; }

.error-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 15px;
  border: 1px solid #f2b8b2;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
  line-height: 1.55;
}

.error-message svg,
.privacy-note svg,
.result-note svg {
  width: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.view-result { width: min(1120px, 100%); margin: 0 auto; }
.view-result[hidden] { display: none; }

.result-canvas {
  min-height: 710px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 45px 36px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}

.success-art {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.result-sheet {
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(123,16,46,.2);
  border-radius: 50%;
}

.result-sheet::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(123,16,46,.45);
  border-radius: 50%;
}

.result-sheet i { position: absolute; display: block; background: var(--coral); transform: rotate(45deg); }
.result-sheet i:nth-child(1) { top: 4px; right: -12px; width: 8px; height: 8px; }
.result-sheet i:nth-child(2) { top: 21px; right: -22px; width: 5px; height: 5px; opacity: .65; }
.result-sheet i:nth-child(3) { display: none; }

.success-art > span {
  z-index: 1;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--plum);
  background: #fff;
}

.success-art svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.result-canvas h1 { font-size: clamp(38px, 4vw, 51px); }
.result-subtitle { margin-top: 13px; }

.result-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 19px 0 29px;
  color: var(--plum);
  font-size: 16px;
  font-weight: 700;
}

.result-status svg { width: 22px; fill: var(--plum); stroke: #fff; stroke-width: 1.7; border-radius: 50%; }

.result-summary {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  margin: 0;
  padding: 25px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.result-summary div { min-width: 0; padding: 0 22px; text-align: center; }
.result-summary div + div { border-left: 1px solid var(--line); }
.result-summary dt { color: var(--muted); font-size: 13px; }
.result-summary dd { margin: 9px 0 0; overflow: hidden; color: var(--ink); font-size: 16px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }

.result-review {
  width: min(980px, 100%);
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: left;
}

.result-review[hidden], .change-list[hidden], .issue-review[hidden] { display: none; }

.review-heading,
.issue-heading,
.change-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.review-heading p {
  margin: 0 0 5px;
  color: var(--plum);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .16em;
}

.review-heading h2 { margin: 0; color: var(--ink); font-size: 21px; letter-spacing: -.02em; }
.review-heading > span,
.issue-heading > span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--plum);
  background: var(--plum-soft);
  font-size: 12px;
  font-weight: 720;
}

.review-gate {
  margin-top: 18px;
  padding: 15px 16px;
  border: 1px solid #e5c9d1;
  border-radius: 12px;
  background: #fff;
}

.review-gate > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.review-gate strong { color: var(--plum); font-size: 14px; }
.review-gate span { color: var(--muted); font-size: 12px; font-weight: 680; }
.review-gate p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.review-gate[data-state="complete"] { border-color: #bcdac9; background: var(--success-soft); }
.review-gate[data-state="complete"] strong { color: var(--success); }
.review-gate[data-state="blocked"] { border-color: #efb9b3; background: var(--danger-soft); }
.review-gate[data-state="blocked"] strong { color: var(--danger); }

.review-progress {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 99px;
  background: #eee7e4;
}

.review-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--plum);
  transition: width 180ms ease;
}

.review-gate[data-state="complete"] .review-progress i { background: var(--success); }
.review-gate[data-state="blocked"] .review-progress i { background: var(--danger); }

.change-list {
  max-height: 430px;
  margin: 19px 0 0;
  padding: 0 7px 0 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: var(--line-strong) transparent;
}

.change-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 178px;
  align-items: center;
  gap: 14px;
  padding: 15px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
}

.change-item + .change-item { margin-top: 9px; }
.change-item:hover { border-color: var(--line-strong); }
.change-item.is-approved { border-color: #c6dfd0; background: #fbfefc; }
.change-item.is-rejected { border-color: #efb9b3; background: var(--danger-soft); }
.change-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--plum);
  background: var(--plum-soft);
  font-size: 12px;
  font-weight: 750;
}

.change-copy { min-width: 0; }
.change-topline { justify-content: flex-start; }
.change-topline strong { color: var(--ink); font-size: 15px; }
.change-topline code {
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--muted);
  background: #f3eeec;
  font-family: var(--font);
  font-size: 11px;
}

.change-copy p { margin: 6px 0 5px; color: var(--text); font-size: 13px; }
.change-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-values { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.change-values > span:not(.value-arrow) {
  min-width: 54px;
  max-width: 118px;
  padding: 7px 10px;
  overflow: hidden;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 720;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.old-value { color: var(--muted); background: #f3f0ef; text-decoration: line-through; }
.new-value { color: var(--plum); background: var(--plum-soft); }
.value-arrow { color: var(--coral); font-size: 16px; }

.change-review-controls,
.issue-review-controls { display: flex; gap: 6px; justify-content: flex-end; }

.change-review-controls { flex-direction: column; }

.review-decision {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.review-decision:hover { border-color: var(--plum); color: var(--plum); }
.review-decision:disabled { cursor: wait; opacity: .55; }
.review-decision.approve.is-active,
.review-decision.acknowledge.is-active { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.review-decision.reject.is-active { border-color: var(--danger); color: var(--danger); background: #fff; }

.issue-review {
  margin-top: 18px;
  padding: 17px 18px;
  border: 1px solid #efc9c3;
  border-radius: 12px;
  background: var(--danger-soft);
}

.issue-heading { justify-content: flex-start; }
.issue-heading strong { color: var(--danger); font-size: 14px; }
.issue-heading > span { color: var(--danger); background: #ffe5e1; }
.issue-review ul { margin: 13px 0 0; padding: 0; list-style: none; }
.issue-review li + li { margin-top: 11px; padding-top: 11px; border-top: 1px dashed #e9b9b1; }
.issue-review li.is-acknowledged { opacity: .72; }
.issue-review p { margin: 0; color: #7c2d24; font-size: 13px; line-height: 1.55; }
.issue-review small { display: block; margin-top: 4px; overflow: hidden; color: #9b554c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.issue-review-controls { margin-top: 9px; justify-content: flex-start; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 30px;
}

.result-actions .primary-button,
.result-actions .secondary-button { min-width: 210px; min-height: 52px; }

.review-feedback {
  min-height: 20px;
  margin: 16px 0 -12px;
  color: var(--plum);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.text-button {
  flex-basis: 100%;
  margin-top: 3px;
  border: 0;
  color: var(--plum);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 660;
}

.text-button:hover { color: var(--plum-dark); }
.text-button span { margin-left: 4px; }

.result-note {
  width: min(930px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 0;
  padding-top: 19px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
}

.help-dialog {
  width: min(610px, calc(100% - 32px));
  padding: 35px 38px 31px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 28px 90px rgba(39,20,26,.24);
}

.help-dialog::backdrop { background: rgba(24,21,23,.46); backdrop-filter: blur(3px); }
.help-dialog h2 { margin: 0 0 20px; color: var(--ink); font-size: 25px; }
.help-dialog ol { margin: 0; padding-left: 23px; }
.help-dialog li { margin: 0 0 12px; padding-left: 5px; line-height: 1.7; }
.help-dialog li::marker { color: var(--plum); font-weight: 700; }

.dialog-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.dialog-close:hover { color: var(--plum); background: var(--plum-soft); }
.dialog-confirm { width: 100%; margin-top: 15px; }

.login-page { background: var(--canvas); }
.login-shell {
  width: min(1040px, calc(100% - 40px));
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 48px 0;
}

.login-panel {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 68px;
  align-items: center;
  padding: 62px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.login-copy { padding-right: 10px; }
.login-lock {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 16px;
  color: var(--plum);
  background: var(--plum-soft);
}

.login-lock svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-copy h1 { font-size: 42px; }
.login-copy p { max-width: 410px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }

.login-form { display: flex; flex-direction: column; }
.login-form label { margin: 0 0 8px; color: var(--ink); font-size: 13px; font-weight: 660; }
.login-form label:not(:first-child) { margin-top: 18px; }
.login-form input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus { border-color: var(--plum); box-shadow: 0 0 0 4px rgba(123,16,46,.1); }
.login-submit { width: 100%; margin-top: 25px; }
.login-error { margin: 14px 0 -4px; padding: 10px 12px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: 13px; line-height: 1.5; }
.login-error[hidden] { display: none; }
.login-security {
  position: absolute;
  bottom: 21px;
  left: 62px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.login-security svg { width: 17px; fill: none; stroke: var(--plum); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.help-button:focus-visible,
.logout-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.review-decision:focus-visible,
.text-button:focus-visible,
.dialog-close:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid rgba(123,16,46,.2);
  outline-offset: 3px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .site-header { height: 68px; padding: 0 16px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand-mark { width: 39px; font-size: 19px; }
  .brand-mark::after { width: 28px; }
  .header-actions { gap: 10px; }
  .help-button { font-size: 0; }
  .help-button svg { width: 23px; }
  .admin-identity { display: none; }
  .logout-button { font-size: 13px; }
  .app-shell { width: min(100% - 28px, 620px); padding: 36px 0 28px; }
  .app-shell::before { display: none; }
  .intro h1, .result-canvas h1 { font-size: 34px; line-height: 1.2; }
  .intro p, .result-subtitle { margin-top: 13px; font-size: 14px; line-height: 1.7; }
  .steps { margin: 27px auto 23px; }
  .steps li { flex-direction: column; gap: 7px; text-align: center; }
  .steps li:not(:last-child)::after { top: 22px; right: -17px; width: 34px; }
  .steps li:not(:last-child)::before { top: 18px; right: -19px; }
  .steps span { width: 43px; height: 43px; flex-basis: 43px; }
  .steps svg { width: 20px; }
  .steps strong { font-size: 12px; }
  .master-card { grid-template-columns: auto 1fr; gap: 13px; padding: 15px; }
  .master-card-icon { width: 50px; height: 50px; }
  .master-card-copy strong { font-size: 15px; }
  .master-button { width: 100%; grid-column: 1 / -1; }
  .drop-zone { min-height: 300px; padding: 31px 18px; }
  .drop-zone h2 { font-size: 21px; text-align: center; }
  .upload-hint { max-width: 310px; text-align: center; }
  .result-canvas { min-height: auto; padding: 38px 18px 27px; }
  .success-art { transform: scale(.88); margin-bottom: 12px; }
  .result-status { margin-bottom: 24px; font-size: 14px; }
  .result-summary { grid-template-columns: repeat(2, 1fr); gap: 22px 0; padding: 22px 9px; }
  .result-summary div { padding: 0 9px; }
  .result-summary div:nth-child(3) { border-left: 0; }
  .result-summary dd { font-size: 14px; }
  .result-review { padding: 19px 14px; }
  .review-heading h2 { font-size: 19px; }
  .review-gate > div:first-child { align-items: flex-start; flex-direction: column; gap: 5px; }
  .change-list { max-height: 520px; padding-right: 0; }
  .change-item { grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 14px 11px; }
  .change-number { width: 31px; height: 31px; }
  .change-topline { align-items: flex-start; flex-direction: column; gap: 5px; }
  .change-values { grid-column: 2; justify-content: flex-start; }
  .change-review-controls { grid-column: 2; flex-direction: row; justify-content: flex-start; }
  .change-values > span:not(.value-arrow) { max-width: 105px; }
  .result-actions { width: 100%; flex-direction: column; }
  .result-actions .primary-button, .result-actions .secondary-button { width: 100%; }
  .text-button { margin-top: 5px; }
  .result-note { align-items: flex-start; text-align: left; line-height: 1.6; }
  .help-dialog { padding: 31px 23px 24px; }
  .login-shell { width: min(100% - 28px, 560px); min-height: calc(100vh - 68px); padding: 30px 0; }
  .login-panel { grid-template-columns: 1fr; gap: 34px; padding: 36px 24px 70px; }
  .login-copy { text-align: center; }
  .login-lock { margin: 0 auto 20px; }
  .login-copy h1 { font-size: 34px; }
  .login-copy p { margin-right: auto; margin-left: auto; }
  .login-security { right: 24px; bottom: 22px; left: 24px; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
