:root {
  color-scheme: light;
  --ink: #211d1a;
  --ink-soft: #665e58;
  --moss: #2e4a36;
  --moss-dark: #203528;
  --coral: #d94762;
  --coral-dark: #b92e49;
  --paper: #fff8f3;
  --paper-deep: #f3ebe4;
  --line: #d9d0c7;
  --sun: #f2c760;
  --success: #2f7750;
  --white: #ffffff;
  --shadow: 0 22px 60px rgb(61 45 36 / 0.1);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgb(46 74 54 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(46 74 54 / 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  line-height: 1.65;
}

button,
input,
select {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  padding: 0 clamp(20px, 5vw, 76px);
  background: rgb(255 248 243 / 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  width: fit-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 38px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 5px;
  background: var(--moss);
  border-radius: 17px 17px 6px 6px;
}

.brand-mark i {
  width: 6px;
  border-radius: 6px;
  background: var(--paper);
}

.brand-mark i:nth-child(1) {
  height: 11px;
}

.brand-mark i:nth-child(2) {
  height: 20px;
  background: var(--sun);
}

.brand-mark i:nth-child(3) {
  height: 15px;
}

.brand b,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand b {
  font-size: 18px;
  letter-spacing: -0.04em;
}

.brand small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

nav a:hover {
  color: var(--coral-dark);
}

.header-state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 700;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgb(47 119 80 / 0.12);
}

.trust-strip {
  min-height: 38px;
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--moss-dark);
  color: rgb(255 255 255 / 0.76);
  overflow-x: auto;
}

.trust-strip span {
  flex: 0 0 auto;
  padding: 8px 22px;
  border-right: 1px solid rgb(255 255 255 / 0.14);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.trust-strip span:first-child {
  border-left: 1px solid rgb(255 255 255 / 0.14);
}

.trust-strip b {
  color: var(--sun);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.intro {
  min-height: 470px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  align-items: center;
  gap: clamp(42px, 8vw, 108px);
  padding: 76px 0 66px;
}

.eyebrow,
.section-label {
  margin: 0 0 13px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 650px;
  margin: 0;
  font-family: "Arial Narrow", Pretendard, "Apple SD Gothic Neo", sans-serif;
  font-size: clamp(48px, 7vw, 82px);
  font-stretch: condensed;
  font-weight: 850;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.intro h1 em {
  position: relative;
  color: var(--coral);
  font-style: normal;
  white-space: nowrap;
}

.intro h1 em::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 1px;
  left: 4px;
  height: 7px;
  background: var(--sun);
  border-radius: 50%;
  transform: rotate(-1.5deg);
  z-index: -1;
}

.intro-copy > p:last-child {
  max-width: 570px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.route-preview {
  position: relative;
  padding: 22px 0 16px;
}

.route-preview::before {
  content: "";
  position: absolute;
  top: 50px;
  bottom: 77px;
  left: 23px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--moss) 0,
    var(--moss) 7px,
    transparent 7px,
    transparent 13px
  );
}

.preview-stop {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 13px 18px 13px 0;
  background: rgb(255 255 255 / 0.62);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 9px 25px rgb(63 45 34 / 0.055);
}

.preview-stop:nth-child(2) {
  transform: translateX(24px);
}

.preview-stop > span {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-left: -1px;
  border: 7px solid var(--paper);
  border-radius: 50%;
  background: var(--moss);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
}

.preview-stop.alert > span {
  background: var(--coral);
}

.preview-stop p {
  margin: 0;
}

.preview-stop b,
.preview-stop small {
  display: block;
}

.preview-stop b {
  font-size: 15px;
}

.preview-stop small {
  color: var(--ink-soft);
}

.preview-caption {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin: 22px 0 0 65px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.preview-caption span,
.preview-caption small {
  color: var(--ink-soft);
  font-size: 12px;
}

.preview-caption strong {
  color: var(--moss);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.preview-caption small {
  grid-column: 1 / -1;
}

.setup-panel {
  margin-bottom: 88px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.setup-heading,
.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.setup-heading {
  justify-content: flex-start;
  padding: 26px 32px;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
}

.setup-heading .section-label {
  min-width: 110px;
}

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

.setup-heading h2,
.results-header h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.045em;
}

.setup-heading p,
.results-header p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.setup-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.field,
.scope-field,
.start-cell {
  min-width: 0;
  margin: 0;
  padding: 27px 32px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field:nth-child(2),
.start-cell {
  border-right: 0;
}

.scope-field,
.start-cell {
  border-bottom: 0;
}

.field > span,
.scope-field legend {
  display: block;
  margin-bottom: 9px;
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #b9aea5;
  border-radius: 6px;
}

.field input[type="file"] {
  min-height: 48px;
  padding: 7px;
  background: var(--white);
}

.field input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 6px 12px;
  color: var(--white);
  background: var(--moss);
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

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

.field small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.scope-field {
  display: flex;
  align-items: center;
  gap: 20px;
}

.scope-field legend {
  float: left;
  margin: 0 18px 0 0;
}

.scope-field label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
}

.scope-field input {
  accent-color: var(--moss);
}

.start-cell {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) 1fr;
  align-items: center;
  gap: 18px;
  background: var(--moss-dark);
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 11px 19px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--coral);
  background: var(--coral);
  color: var(--white);
  box-shadow: 0 7px 0 var(--coral-dark);
  transform: translateY(-3px);
}

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

.primary-button:active {
  box-shadow: 0 2px 0 var(--coral-dark);
  transform: translateY(2px);
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.start-cell p {
  margin: 0;
  color: rgb(255 255 255 / 0.72);
  font-size: 12px;
}

.results {
  padding: 12px 0 80px;
  scroll-margin-top: 130px;
}

.results-header {
  padding-bottom: 24px;
}

.results-header .section-label {
  margin-bottom: 6px;
}

.secondary-button {
  border: 1px solid var(--moss);
  background: transparent;
  color: var(--moss);
}

.secondary-button:hover {
  background: var(--moss);
  color: var(--white);
}

.run-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgb(255 255 255 / 0.75);
}

.run-summary div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 17px 22px;
  border-right: 1px solid var(--line);
}

.run-summary div:last-child {
  border-right: 0;
}

.run-summary strong {
  color: var(--moss);
  font-size: 27px;
  line-height: 1;
}

.run-summary span {
  color: var(--ink-soft);
  font-size: 12px;
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 20px;
}

.route-log,
.finding-board {
  min-width: 0;
  padding: 25px;
  background: rgb(255 255 255 / 0.74);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.route-log-heading,
.finding-board-heading,
.flow-heading,
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.route-log-heading,
.finding-board-heading {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.route-log-heading h3,
.finding-board-heading h3 {
  margin: 0;
  font-size: 17px;
}

.route-log-heading span,
.finding-board-heading span {
  color: var(--ink-soft);
  font-size: 11px;
}

.flow-list {
  position: relative;
  padding: 22px 0 0;
}

.flow-list::before {
  content: "";
  position: absolute;
  top: 37px;
  bottom: 30px;
  left: 20px;
  width: 2px;
  background: var(--line);
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 17px;
  margin-bottom: 14px;
}

.route-marker {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 6px solid var(--white);
  border-radius: 50%;
  background: var(--moss);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.flow-step.fail .route-marker {
  background: var(--coral);
}

.flow-step.needs_evidence .route-marker {
  background: #8b6a1f;
}

.flow-copy {
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.flow-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.flow-site {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.verdict {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgb(47 119 80 / 0.1);
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
}

.flow-step.fail .verdict {
  background: rgb(217 71 98 / 0.1);
  color: var(--coral-dark);
}

.actual {
  margin: 11px 0 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

details {
  color: var(--ink-soft);
  font-size: 12px;
}

summary {
  width: fit-content;
  color: var(--moss);
  font-weight: 800;
  cursor: pointer;
}

details ol {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 17px;
  padding-left: 18px;
}

.finding-list {
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.agnes-panel {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 20px;
  background: #f1f6f4;
  border: 1px solid #9bb9ad;
  border-radius: 16px;
}

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

.agnes-panel h3,
.agnes-panel p {
  margin: 0;
}

.agnes-panel small {
  color: var(--moss);
  font-weight: 800;
}

.finding {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 15px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  cursor: pointer;
}

.finding:hover {
  border-color: var(--moss);
}

.finding.critical {
  border-left-color: var(--coral);
}

.finding.major {
  border-left-color: #bf8122;
}

.finding.notice {
  border-left-color: var(--moss);
}

.finding-level {
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.finding strong {
  font-size: 13px;
  line-height: 1.45;
}

.finding > span:last-child {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 30px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed #bdb2a9;
  border-radius: 7px;
}

.empty-state.compact {
  min-height: 120px;
}

.empty-state b,
.empty-state span {
  display: block;
}

.empty-state b {
  color: var(--ink);
}

.empty-state span {
  font-size: 12px;
}

.method-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 80px;
  padding: 23px 26px;
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.method-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--moss);
  border-radius: 50%;
  color: var(--moss);
  font-weight: 900;
}

.method-note h2 {
  margin: 0 0 3px;
  font-size: 16px;
}

.method-note p {
  max-width: 750px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.method-note a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--moss);
  font-size: 12px;
  font-weight: 800;
}

.finding-detail {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(430px, 92vw);
  height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  background: var(--white);
  border-left: 1px solid var(--line);
  box-shadow: -25px 0 70px rgb(33 29 26 / 0.16);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.finding-detail.open {
  transform: translateX(0);
}

.finding-detail h3 {
  margin: 28px 0 24px;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.finding-detail dl {
  margin: 0;
}

.finding-detail dl div {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.finding-detail dt {
  margin-bottom: 7px;
  color: var(--moss);
  font-size: 11px;
  font-weight: 900;
}

.finding-detail dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(20px, 5vw, 76px);
  background: var(--moss-dark);
  color: rgb(255 255 255 / 0.66);
  font-size: 11px;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 42px;
    padding-top: 58px;
  }

  .route-preview {
    max-width: 600px;
  }

  .setup-grid,
  .evidence-layout {
    grid-template-columns: 1fr;
  }

  .upload-field {
    grid-column: auto;
  }

  .field,
  .scope-field,
  .start-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .start-cell {
    border-bottom: 0;
  }

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

  .run-summary div:nth-child(2) {
    border-right: 0;
  }

  .run-summary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 600px) {
  main {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    min-height: 66px;
    padding: 0 15px;
  }

  .header-state {
    font-size: 11px;
  }

  .trust-strip {
    justify-content: flex-start;
  }

  .intro {
    min-height: auto;
    padding: 50px 0;
  }

  .intro h1 {
    font-size: clamp(44px, 15vw, 62px);
  }

  .intro-copy > p:last-child {
    font-size: 15px;
  }

  .preview-stop:nth-child(2) {
    transform: translateX(8px);
  }

  .setup-heading,
  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .setup-heading {
    gap: 0;
    padding: 22px;
  }

  .field,
  .scope-field,
  .start-cell {
    padding: 22px;
  }

  .scope-field {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .scope-field legend {
    float: none;
    margin: 0 0 8px;
  }

  .start-cell {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .results-header .secondary-button {
    width: 100%;
  }

  .run-summary div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 15px;
  }

  .route-log,
  .finding-board {
    padding: 18px;
  }

  .flow-copy {
    padding: 14px;
  }

  .flow-heading {
    align-items: flex-start;
  }

  .method-note {
    grid-template-columns: auto 1fr;
  }

  .method-note a {
    grid-column: 2;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
