:root {
  --yearn-blue: #0675f9;
  --yearn-blue-bright: #52a9ff;
  --yearn-blue-deep: #003f99;
  --yearn-blue-night: #02295f;
  --white: #ffffff;
  --black: #000000;
  --ink-soft: #111319;
  --line-soft: #bdbdbd;
  --line-mid: #969696;
  --line-strong: #4f4f4f;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-strong: rgba(255, 255, 255, 0.99);
  --ok-bg: #e8f3ff;
  --ok-ink: #0457bb;
  --bad-bg: #ffe8e8;
  --bad-ink: #890000;
  --warn-bg: #fff4d9;
  --warn-ink: #5f4500;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--black);
  font-family: 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f8fbff;
  overflow-x: hidden;
}

.bg-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.bg-orb {
  position: absolute;
  width: 54vmax;
  height: 54vmax;
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(24px);
  mix-blend-mode: multiply;
}

.orb-a {
  top: -28vmax;
  left: -18vmax;
  background: radial-gradient(circle at 45% 45%, var(--yearn-blue-bright), transparent 67%);
  animation: driftA 26s linear infinite alternate;
}

.orb-b {
  top: -12vmax;
  right: -24vmax;
  background: radial-gradient(circle at 42% 40%, #91d5ff, transparent 70%);
  animation: driftB 34s linear infinite alternate;
}

.orb-c {
  bottom: -30vmax;
  left: 18vmax;
  background: radial-gradient(circle at 50% 50%, #0a84ff, transparent 69%);
  animation: driftC 39s linear infinite alternate;
}

.bg-grid {
  position: absolute;
  inset: -30%;
  background:
    repeating-linear-gradient(90deg, rgba(6, 117, 249, 0.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(6, 117, 249, 0.045) 0 1px, transparent 1px 24px);
  transform-origin: center;
  animation: rotateGrid 50s linear infinite;
}

.bg-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 117, 249, 0.09) 50%, transparent 100%);
  animation: scanMove 12s ease-in-out infinite;
  opacity: 0.5;
}

.app-shell {
  width: min(1160px, calc(100% - 2rem));
  margin: 1.6rem auto 2.6rem;
  position: relative;
}

.hero {
  padding: 1.15rem 1.25rem;
  border: 2px solid var(--line-strong);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.87)),
    linear-gradient(90deg, rgba(6, 117, 249, 0.14), rgba(6, 117, 249, 0));
  box-shadow:
    0 20px 60px rgba(2, 41, 95, 0.14),
    0 0 0 1px rgba(6, 117, 249, 0.12) inset;
  animation: revealHero 380ms cubic-bezier(0.11, 0.8, 0.24, 1);
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yearn-blue);
  font-weight: 800;
}

.eyebrow-link {
  display: inline-block;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.eyebrow-link:hover {
  color: var(--yearn-blue-night);
  border-bottom-color: var(--yearn-blue-night);
  transform: translateY(-1px);
}

h1 {
  margin: 0.45rem 0 0;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  font-weight: 900;
  line-height: 0.97;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #01040a;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 24px rgba(6, 117, 249, 0.16);
}

.subtitle {
  margin: 0.62rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  max-width: 58ch;
  color: var(--ink-soft);
}

.panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  backdrop-filter: blur(4px);
  box-shadow:
    0 14px 30px rgba(2, 41, 95, 0.11),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: var(--line-mid);
  box-shadow:
    0 20px 40px rgba(2, 41, 95, 0.13),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.step-panel {
  position: relative;
  overflow: clip;
}

.step-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, var(--yearn-blue), transparent);
  opacity: 0.8;
}

.step-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 24%, rgba(6, 117, 249, 0.17) 52%, transparent 80%);
  pointer-events: none;
  opacity: 0;
}

.step-panel.impact-next::after {
  animation: panelSweep 320ms ease-out;
}

h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.22rem, 2vw, 1.68rem);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(230px, 1fr));
  gap: 0.9rem;
}

.step1-config {
  margin-top: 0.85rem;
}

.step-actions {
  margin-top: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.step-actions .btn {
  margin-top: 0;
}

.span-2 {
  grid-column: span 2;
}

.field-block {
  display: grid;
  gap: 0.45rem;
}

.block-title {
  font-size: 0.97rem;
  font-weight: 700;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.97rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  color: var(--black);
  border-radius: 0;
  padding: 0.64rem 0.7rem;
  font: inherit;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) inset;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

input::placeholder {
  color: #6f7685;
}

input:hover {
  border-color: var(--line-mid);
  background: #ffffff;
}

input:focus {
  outline: 0;
  border-color: var(--yearn-blue);
  box-shadow:
    0 0 0 2px rgba(6, 117, 249, 0.16),
    0 0 0 1px rgba(6, 117, 249, 0.35) inset;
  transform: translateY(-1px);
}

.dynamic-list {
  display: grid;
  gap: 0.55rem;
}

.dynamic-row {
  display: grid;
  gap: 0.55rem;
  align-items: center;
}

.address-row {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.repo-row {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.6fr) auto;
}

.btn {
  margin-top: 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 0.56rem 0.96rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
  --mx: 50%;
  --my: 50%;
}

.btn::after {
  content: '';
  position: absolute;
  left: var(--mx);
  top: var(--my);
  width: 0;
  height: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: width 280ms ease, height 280ms ease, opacity 280ms ease;
  opacity: 0;
}

.btn:hover::after {
  width: 220px;
  height: 220px;
  opacity: 0.12;
}

.btn:active,
.btn.bump {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 20px rgba(2, 41, 95, 0.22);
}

.btn.primary {
  background: linear-gradient(132deg, var(--yearn-blue), #0a87ff 70%, #3db1ff 100%);
  color: var(--white);
  border-color: rgba(6, 117, 249, 0.65);
}

.btn.primary::after {
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
}

.btn.primary:hover {
  background: linear-gradient(132deg, #056de8, #087cf2 70%, #37a8ff 100%);
}

.btn.ghost {
  background: linear-gradient(180deg, #ffffff, #f7faff);
  color: var(--black);
  margin-top: 0;
}

.btn.ghost::after {
  background: radial-gradient(circle, rgba(6, 117, 249, 0.95) 0%, transparent 72%);
}

.btn.ghost:hover {
  border-color: rgba(6, 117, 249, 0.5);
  background: linear-gradient(180deg, #ffffff, #edf4ff);
}

.mini-btn {
  margin-top: 0;
  padding: 0.36rem 0.62rem;
  font-size: 0.77rem;
  white-space: nowrap;
}

.row-remove-btn {
  align-self: stretch;
}

.row-remove-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.status {
  min-height: 1.25rem;
  margin: 0.7rem 0 0;
  font-weight: 700;
  transition: color 120ms ease;
}

.status.info {
  color: #1c2332;
}

.status.success {
  color: var(--ok-ink);
}

.status.error {
  color: var(--bad-ink);
}

.status.warn {
  color: var(--warn-ink);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.panel-head .actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-meta {
  display: none;
}

.files-list {
  border: 1px solid var(--line-soft);
  border-radius: 0;
  max-height: 430px;
  overflow: auto;
  background: var(--surface-strong);
}

.file-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.58rem 0.72rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transform: translateZ(0);
  transition:
    background-color 170ms ease,
    transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 170ms ease;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: rgba(6, 117, 249, 0.06);
  transform: translateX(4px);
  box-shadow: inset 3px 0 0 rgba(6, 117, 249, 0.45);
}

.file-row.is-selected {
  background: rgba(6, 117, 249, 0.095);
  box-shadow: inset 2px 0 0 rgba(6, 117, 249, 0.55);
}

.file-row.is-selected:hover {
  background: rgba(6, 117, 249, 0.12);
  box-shadow: inset 4px 0 0 rgba(6, 117, 249, 0.65);
}

.file-row input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  border: 1px solid var(--line-mid);
  border-radius: 0;
  background: #fff;
  display: grid;
  place-content: center;
  transition: border-color 140ms ease, background-color 140ms ease, transform 110ms ease;
}

.file-row input[type='checkbox']::before {
  content: '';
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 120ms ease;
  background: var(--yearn-blue);
}

.file-row input[type='checkbox']:checked {
  border-color: var(--yearn-blue);
  background: #f0f7ff;
}

.file-row input[type='checkbox']:checked::before {
  transform: scale(1);
}

.file-row input[type='checkbox']:active {
  transform: scale(0.94);
}

.file-path {
  font-family: 'Noto Sans Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.86rem;
  word-break: break-all;
}

.file-path-wrap {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.file-source {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #4f5c74;
  font-family: 'Noto Sans Mono', 'SFMono-Regular', Consolas, monospace;
  word-break: break-all;
}

.file-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.34rem;
  flex-wrap: wrap;
}

.file-tag {
  border: 1px solid rgba(6, 117, 249, 0.45);
  background: rgba(6, 117, 249, 0.08);
  color: var(--yearn-blue-night);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.file-tag-contract {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #1f2432;
}

.verify-results {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.result-card {
  border: 1px solid var(--line-soft);
  padding: 0.74rem;
  background: var(--surface-strong);
  animation: resultPop 200ms ease-out;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(2, 41, 95, 0.12);
}

.result-card.result-match {
  border-color: rgba(6, 117, 249, 0.4);
}

.result-card.result-mismatch {
  border-color: rgba(137, 0, 0, 0.24);
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.result-path {
  font-family: 'Noto Sans Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.86rem;
  word-break: break-all;
}

.badge {
  font-size: 0.73rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid #00000024;
}

.badge.match {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.badge.mismatch {
  background: var(--bad-bg);
  color: var(--bad-ink);
}

.reason {
  margin: 0.5rem 0 0;
  color: #1a2130;
}

.reason-exact-match {
  color: var(--yearn-blue);
  font-weight: 700;
}

.reason-manual-check {
  color: var(--yearn-blue);
  font-weight: 800;
  font-size: 0.92rem;
}

.matched-path {
  margin: 0.3rem 0 0;
  color: #2a3040;
  font-size: 0.9rem;
}

.manual-path-wrap {
  margin-top: 0.45rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid rgba(6, 117, 249, 0.2);
  background: rgba(6, 117, 249, 0.04);
}

.matched-path-link {
  border: 0;
  background: transparent;
  color: var(--yearn-blue-night);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.matched-path-link:hover {
  color: var(--yearn-blue);
  text-decoration: underline;
}

.manual-path-panel {
  margin-top: 0.48rem;
  padding-top: 0.48rem;
  border-top: 1px dashed rgba(6, 117, 249, 0.25);
}

.manual-path-help {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: #2a3040;
}

.repo-path-input {
  width: 100%;
  font-family: 'Noto Sans Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.78rem;
}

.manual-path-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.48rem;
}

.manual-btn {
  margin-top: 0;
  padding: 0.36rem 0.68rem;
  font-size: 0.78rem;
}

.diff-details {
  margin-top: 0.62rem;
  border: 1px solid var(--line-soft);
  background: var(--white);
}

.diff-summary {
  cursor: pointer;
  font-weight: 800;
  padding: 0.5rem 0.72rem;
  background: linear-gradient(90deg, #edf4ff, #f6f9ff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  list-style: none;
  transition: background-color 140ms ease;
}

.diff-summary:hover {
  background: linear-gradient(90deg, #e1eeff, #eef5ff);
}

.diff-summary::-webkit-details-marker {
  display: none;
}

.diff-summary::before {
  content: '▸';
  margin-right: 0.4rem;
  color: var(--yearn-blue-deep);
}

.diff-details[open] .diff-summary::before {
  content: '▾';
}

.diff-legend {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.52rem 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fbfdff;
}

.legend-pill {
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0.15rem 0.48rem;
}

.legend-pill.removed {
  background: #ffe8e8;
  color: #8e0000;
}

.legend-pill.added {
  background: #e8f3ff;
  color: #0457bb;
}

.diff-board {
  max-height: 430px;
  overflow: auto;
}

.diff-row {
  display: grid;
  grid-template-columns: 58px 58px 24px minmax(260px, 1fr);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  font-family: 'Noto Sans Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.34;
}

.diff-row:first-child {
  border-top: 0;
}

.diff-row.ctx {
  background: #fff;
}

.diff-row.add {
  background: #e9f5ff;
}

.diff-row.del {
  background: #ffe9e9;
}

.diff-row.hunk {
  background: #dcecff;
  color: #003e8b;
}

.diff-row.meta,
.diff-row.note {
  background: #f6f6f6;
  color: #3f3f3f;
}

.diff-row.note {
  font-style: italic;
}

.diff-line-num {
  display: block;
  text-align: right;
  color: #4d4d4d;
  padding: 0.18rem 0.45rem;
  border-right: 1px solid rgba(0, 0, 0, 0.13);
  user-select: none;
}

.diff-line-num.empty {
  color: transparent;
}

.diff-sign {
  display: block;
  text-align: center;
  padding: 0.18rem 0.15rem;
  border-right: 1px solid rgba(0, 0, 0, 0.13);
  user-select: none;
  font-weight: 800;
}

.diff-row.add .diff-sign {
  color: #0457bb;
}

.diff-row.del .diff-sign {
  color: #8f0000;
}

.diff-row.hunk .diff-sign {
  color: #003e8b;
}

.diff-code {
  display: block;
  padding: 0.18rem 0.55rem;
  white-space: pre;
}

.brand-credit {
  margin-top: 1rem;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
}

.brand-credit a {
  color: var(--yearn-blue-night);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.brand-credit a:hover {
  color: var(--yearn-blue);
  border-bottom-color: var(--yearn-blue);
}

[hidden] {
  display: none !important;
}

@keyframes revealHero {
  0% {
    transform: translateY(16px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes panelSweep {
  0% {
    transform: translateX(-130%);
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  100% {
    transform: translateX(140%);
    opacity: 0;
  }
}

@keyframes resultPop {
  0% {
    transform: translateY(8px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes driftA {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10vmax, 7vmax) scale(1.1);
  }
}

@keyframes driftB {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-14vmax, 6vmax) scale(1.08);
  }
}

@keyframes driftC {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(9vmax, -7vmax) scale(1.09);
  }
}

@keyframes rotateGrid {
  0% {
    transform: rotate(0deg) scale(1.08);
  }
  100% {
    transform: rotate(4deg) scale(1.12);
  }
}

@keyframes scanMove {
  0%,
  100% {
    transform: translateY(-18%);
  }
  50% {
    transform: translateY(18%);
  }
}

@media (max-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .address-row,
  .repo-row {
    grid-template-columns: 1fr;
  }

  .row-remove-btn {
    justify-self: start;
  }

  .panel-head,
  .result-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .diff-row {
    grid-template-columns: 44px 44px 20px minmax(180px, 1fr);
  }

  .brand-credit {
    text-align: left;
  }

  .btn,
  input {
    width: 100%;
  }
}
